Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ jobs:
ccache --zero-stats

- name: Configure (top-level cmake)
# Sanitizer adds significant link-time memory/cpu cost and CI does
# not run binaries, so it adds no value here. Use Release for the
# build verification. Wire ccache via compiler launchers.
# Keep the full-protocol build and deterministic regressions in
# Release mode. Debug+ASan workload checks run separately.
# Wire ccache via compiler launchers.
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_SANITIZER=OFF \
-DCCBENCH_BUILD_SILO_TESTS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache

Expand All @@ -82,6 +83,9 @@ jobs:
# longer build that here.)
run: cmake --build build -j $(nproc)

- name: Test Silo transaction regressions
run: ctest --test-dir build -R '^silo_regression_test$' --output-on-failure

- name: ccache stats
if: always()
run: ccache --show-stats
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ include(Options)
option(ENABLE_SANITIZER "enable sanitizer on debug build" ON)
option(ENABLE_UB_SANITIZER "enable undefined behavior sanitizer on debug build" OFF)
option(ENABLE_COVERAGE "enable coverage on debug build" OFF)
option(CCBENCH_BUILD_SILO_TESTS "build deterministic Silo regression tests" OFF)
if(CCBENCH_BUILD_SILO_TESTS)
enable_testing()
endif()

# Auto-enable ccache when available — local builds also benefit from
# the cross-target dedup we get in CI. Override with -DCCBENCH_CCACHE=OFF.
Expand Down
14 changes: 14 additions & 0 deletions cc/silo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,17 @@ target_link_libraries(replay_test.exe PRIVATE
target_compile_definitions(replay_test.exe PRIVATE ${_universal_defs})
# Same -Wall -Wextra -Werror as the ccbench_add_protocol() binaries (#43).
set_compile_options(replay_test.exe)

if(CCBENCH_BUILD_SILO_TESTS)
add_executable(silo_regression_test
test/transaction_test.cc transaction.cc util.cc)
target_link_libraries(silo_regression_test PRIVATE
ccbench_common ccbench::masstree ccbench::mimalloc GTest::gtest_main)
# Keep protocol switches and Result's layout identical to the workload target.
get_target_property(_silo_test_defs tpcc_silo.exe COMPILE_DEFINITIONS)
target_compile_definitions(silo_regression_test PRIVATE ${_silo_test_defs})
set_compile_options(silo_regression_test)
add_test(NAME silo_regression_test COMMAND silo_regression_test)
# The old read protocol spins forever on these deliberately pending INSERTs.
set_tests_properties(silo_regression_test PROPERTIES TIMEOUT 20)
endif()
10 changes: 9 additions & 1 deletion cc/silo/include/transaction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ class TxScanCallback;

class TxExecutor {
public:
struct RetiredRecord {
Tuple* record;
uint64_t epoch;
};

std::vector<ReadElement<Tuple>> read_set_;
std::vector<WriteElement<Tuple>> write_set_;
std::vector<Procedure> pro_set_;
std::deque<Tuple*> gc_records_;
std::deque<RetiredRecord> gc_records_;
std::unordered_map<void*, uint64_t> node_map_;

std::vector<LogRecord> log_set_;
Expand Down Expand Up @@ -161,6 +166,9 @@ public:
void leaderWork();

void gc_records();

private:
void retire_insert(WriteElement<Tuple>& element);
};

static_assert(TxExecutorLike<TxExecutor>);
Loading
Loading