-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
157 lines (143 loc) · 8.7 KB
/
CMakeLists.txt
File metadata and controls
157 lines (143 loc) · 8.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
cmake_minimum_required (VERSION 3.11)
list(APPEND COMMON_DEPS homestore::homestore)
# This is a work-around for not being able to specify the link
# order in a conan recipe. We link these explicitly and thus
# need to specify the LINK path. They should only be needed
# to build a DSO (test executable) however.
link_directories(${spdk_LIB_DIRS} ${dpdk_LIB_DIRS})
list(APPEND COMMON_TEST_DEPS
${spdk_LIBRARY_LIST}
${dpdk_LIBRARY_LIST}
)
if(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
endif()
add_library ("${PROJECT_NAME}_homestore")
target_sources("${PROJECT_NAME}_homestore" PRIVATE
hs_homeobject.cpp
hs_blob_manager.cpp
hs_shard_manager.cpp
hs_pg_manager.cpp
pg_blob_iterator.cpp
snapshot_receive_handler.cpp
index_kv.cpp
heap_chunk_selector.cpp
replication_state_machine.cpp
hs_cp_callbacks.cpp
hs_http_manager.cpp
gc_manager.cpp
$<TARGET_OBJECTS:${PROJECT_NAME}_core>
)
target_link_libraries("${PROJECT_NAME}_homestore" PUBLIC
homestore::homestore
${COMMON_DEPS}
)
set(FLATBUFFERS_FLATC_EXECUTABLE ${flatbuffers_INCLUDE_DIRS}/../bin/flatc)
settings_gen_cpp(
${FLATBUFFERS_FLATC_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/generated/
"${PROJECT_NAME}_homestore"
hs_backend_config.fbs
resync_pg_data.fbs
resync_shard_data.fbs
resync_blob_data.fbs
)
# Unit test objects
add_subdirectory(tests)
# Basic tests
add_executable(homestore_test_pg)
target_sources(homestore_test_pg PRIVATE $<TARGET_OBJECTS:homestore_tests_pg>)
target_link_libraries(homestore_test_pg PUBLIC homeobject_homestore ${COMMON_TEST_DEPS})
add_test(NAME HomestoreTestPg COMMAND homestore_test_pg -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance:0
--override_config homestore_config.consensus.max_grpc_message_size:138412032)
add_executable(homestore_test_shard)
target_sources(homestore_test_shard PRIVATE $<TARGET_OBJECTS:homestore_tests_shard>)
target_link_libraries(homestore_test_shard PUBLIC homeobject_homestore ${COMMON_TEST_DEPS})
add_test(NAME HomestoreTestShard COMMAND homestore_test_shard -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance:0
--override_config homestore_config.consensus.max_grpc_message_size:138412032)
add_executable(homestore_test_blob)
target_sources(homestore_test_blob PRIVATE $<TARGET_OBJECTS:homestore_tests_blob>)
target_link_libraries(homestore_test_blob PUBLIC homeobject_homestore ${COMMON_TEST_DEPS})
add_test(NAME HomestoreTestBlob COMMAND homestore_test_blob -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance:0
--override_config homestore_config.consensus.max_grpc_message_size:138412032)
add_executable(homestore_test_misc)
target_sources(homestore_test_misc PRIVATE $<TARGET_OBJECTS:homestore_tests_misc>)
target_link_libraries(homestore_test_misc PUBLIC homeobject_homestore ${COMMON_TEST_DEPS})
add_test(NAME HomestoreTestMisc COMMAND homestore_test_misc -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance=0
--override_config homestore_config.consensus.max_grpc_message_size=138412032
--override_config hs_backend_config.enable_gc=false)
# Dynamic tests
add_executable(homestore_test_dynamic)
target_sources(homestore_test_dynamic PRIVATE $<TARGET_OBJECTS:homestore_tests_dynamic>)
target_link_libraries(homestore_test_dynamic PUBLIC homeobject_homestore ${COMMON_TEST_DEPS})
add_test(NAME HomestoreTestReplaceMember
COMMAND homestore_test_dynamic -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance=0
--override_config homestore_config.generic.repl_dev_cleanup_interval_sec=5
--override_config homestore_config.consensus.max_grpc_message_size=138412032
--override_config homestore_config.consensus.replace_member_sync_check_interval_ms=1000
--override_config homestore_config.consensus.laggy_threshold=2000
--gtest_filter=HomeObjectFixture.ReplaceMember)
# To test both baseline & incremental resync functionality, we use 13 to minimize the likelihood of it being a divisor of the total LSN (currently 30)
add_test(NAME HomestoreTestReplaceMemberWithBaselineResync
COMMAND homestore_test_dynamic -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance=13
--override_config homestore_config.consensus.num_reserved_log_items=13
--override_config homestore_config.resource_limits.raft_logstore_reserve_threshold=13
--override_config homestore_config.consensus.snapshot_sync_ctx_timeout_ms=5000
--override_config homestore_config.generic.repl_dev_cleanup_interval_sec=5
--override_config homestore_config.consensus.max_grpc_message_size=138412032
--override_config homestore_config.consensus.replace_member_sync_check_interval_ms=1000
--override_config homestore_config.consensus.laggy_threshold=2000
--gtest_filter=HomeObjectFixture.ReplaceMember)
add_test(NAME HomestoreResyncTestWithFollowerRestart
COMMAND homestore_test_dynamic -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance=13
--override_config homestore_config.consensus.num_reserved_log_items=13
--override_config homestore_config.resource_limits.raft_logstore_reserve_threshold=13
--override_config homestore_config.consensus.snapshot_sync_ctx_timeout_ms=5000
--override_config homestore_config.generic.repl_dev_cleanup_interval_sec=5
--override_config homestore_config.consensus.max_grpc_message_size=138412032
--override_config homestore_config.consensus.replace_member_sync_check_interval_ms=1000
--override_config homestore_config.consensus.laggy_threshold=2000
--gtest_filter=HomeObjectFixture.RestartFollower*)
add_test(NAME HomestoreResyncTestWithLeaderRestart
COMMAND homestore_test_dynamic -csv error --executor immediate --config_path ./
--override_config homestore_config.consensus.snapshot_freq_distance=13
--override_config homestore_config.consensus.num_reserved_log_items=13
--override_config homestore_config.resource_limits.raft_logstore_reserve_threshold=13
--override_config homestore_config.consensus.snapshot_sync_ctx_timeout_ms=5000
--override_config homestore_config.generic.repl_dev_cleanup_interval_sec=5
--override_config homestore_config.consensus.max_grpc_message_size=138412032
--override_config homestore_config.consensus.replace_member_sync_check_interval_ms=1000
--override_config homestore_config.consensus.laggy_threshold=2000
--gtest_filter=HomeObjectFixture.RestartLeader*)
#add_test(NAME HomestoreReplaceMemberRollbackTest
# COMMAND homestore_test_dynamic -csv error --executor immediate --config_path ./
# --override_config homestore_config.consensus.snapshot_freq_distance=13
# --override_config homestore_config.consensus.num_reserved_log_items=13
# --override_config homestore_config.resource_limits.raft_logstore_reserve_threshold=13
# --override_config homestore_config.consensus.snapshot_sync_ctx_timeout_ms=5000
# --override_config homestore_config.generic.repl_dev_cleanup_interval_sec=5
# --override_config homestore_config.consensus.max_grpc_message_size=138412032
# --override_config homestore_config.consensus.replace_member_sync_check_interval_ms=60000
# --override_config homestore_config.consensus.laggy_threshold=1
# --gtest_filter=HomeObjectFixture.RollbackReplaceMember)
# GC tests
add_test(NAME FetchDataWithOriginatorGC
COMMAND homestore_test_dynamic -csv error --executor immediate --config_path ./
--override_config hs_backend_config.enable_gc=true
--override_config hs_backend_config.gc_enable_read_verify=true
--gtest_filter=HomeObjectFixture.FetchDataWithOriginatorGC)
add_executable(homestore_test_gc)
target_sources(homestore_test_gc PRIVATE $<TARGET_OBJECTS:homestore_tests_gc>)
target_link_libraries(homestore_test_gc PUBLIC homeobject_homestore ${COMMON_TEST_DEPS})
add_test(NAME HomestoreTestGC COMMAND homestore_test_gc -csv error --executor immediate --config_path ./
--override_config hs_backend_config.enable_gc=true
--override_config hs_backend_config.gc_enable_read_verify=true
--override_config hs_backend_config.gc_garbage_rate_threshold=0
--override_config hs_backend_config.gc_scan_interval_sec=5)