Skip to content

Commit 0bc2ea6

Browse files
committed
chore: reproduce MultiLeavesTxQueue fails on multi-shard
Signed-off-by: kostas <[email protected]>
1 parent 70be62c commit 0bc2ea6

File tree

3 files changed

+56
-50
lines changed

3 files changed

+56
-50
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ jobs:
129129
- name: Build
130130
run: |
131131
cd ${GITHUB_WORKSPACE}/build
132-
ninja search_family_test
132+
#ninja search_family_test
133133
df -h
134134
echo "-----------------------------"
135-
ninja src/all
135+
ninja multi_test
136136
137137
- name: PostFail
138138
if: failure()
@@ -145,60 +145,62 @@ jobs:
145145
cd ${GITHUB_WORKSPACE}/build
146146
echo Run ctest -V -L DFLY
147147
148-
GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1,op_manager=1,op_manager_test=1 \
149-
FLAGS_fiber_safety_margin=4096 FLAGS_list_experimental_v2=true timeout 20m ctest -V -L DFLY -E allocation_tracker_test
150-
151-
# Run allocation tracker test separately without alsologtostderr because it generates a TON of logs.
152-
FLAGS_fiber_safety_margin=4096 timeout 5m ./allocation_tracker_test
153-
154-
timeout 5m ./dragonfly_test
155-
timeout 5m ./json_family_test --jsonpathv2=false
156-
timeout 5m ./tiered_storage_test --vmodule=db_slice=2 --logtostderr
157-
158-
159-
- name: C++ Unit Tests - Epoll
160-
run: |
161-
cd ${GITHUB_WORKSPACE}/build
162-
163-
# Create a rule that automatically prints stacktrace upon segfault
164-
cat > ./init.gdb <<EOF
165-
catch signal SIGSEGV
166-
command
167-
bt
168-
end
169-
EOF
170-
171-
gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll
172-
FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 timeout 20m ctest -V -L DFLY -E allocation_tracker_test
173-
174-
FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true timeout 5m ./allocation_tracker_test
175-
176-
- name: C++ Unit Tests - IoUring with cluster mode
177-
run: |
178-
FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated timeout 20m ctest -V -L DFLY
179-
180-
- name: C++ Unit Tests - IoUring with cluster mode and FLAGS_lock_on_hashtags
181-
run: |
182-
FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated FLAGS_lock_on_hashtags=true timeout 20m ctest -V -L DFLY
183-
148+
#GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1,op_manager=1,op_manager_test=1 \
149+
#FLAGS_fiber_safety_margin=4096 FLAGS_list_experimental_v2=true timeout 20m ctest -V -L DFLY -E allocation_tracker_test
150+
151+
## Run allocation tracker test separately without alsologtostderr because it generates a TON of logs.
152+
#FLAGS_fiber_safety_margin=4096 timeout 5m ./allocation_tracker_test
153+
154+
#timeout 5m ./dragonfly_test
155+
#timeout 5m ./json_family_test --jsonpathv2=false
156+
#timeout 5m ./tiered_storage_test --vmodule=db_slice=2 --logtostderr
157+
FLAGS_cluster_mode=emulated ./multi_test
158+
FLAGS_cluster_mode=emulated FLAGS_lock_on_hashtags=true ./multi_Test
159+
160+
161+
# - name: C++ Unit Tests - Epoll
162+
# run: |
163+
# cd ${GITHUB_WORKSPACE}/build
164+
#
165+
# # Create a rule that automatically prints stacktrace upon segfault
166+
# cat > ./init.gdb <<EOF
167+
# catch signal SIGSEGV
168+
# command
169+
# bt
170+
# end
171+
# EOF
172+
#
173+
# gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll
174+
# FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 timeout 20m ctest -V -L DFLY -E allocation_tracker_test
175+
#
176+
# FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true timeout 5m ./allocation_tracker_test
177+
#
178+
# - name: C++ Unit Tests - IoUring with cluster mode
179+
# run: |
180+
# FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated timeout 20m ctest -V -L DFLY
181+
#
182+
# - name: C++ Unit Tests - IoUring with cluster mode and FLAGS_lock_on_hashtags
183+
# run: |
184+
# FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated FLAGS_lock_on_hashtags=true timeout 20m ctest -V -L DFLY
185+
#
184186
- name: Upload unit logs on failure
185187
if: failure()
186188
uses: actions/upload-artifact@v4
187189
with:
188190
name: unit_logs
189191
path: /tmp/*INFO*
190192

191-
- name: Run regression tests
192-
if: matrix.container == 'ubuntu-dev:20'
193-
uses: ./.github/actions/regression-tests
194-
with:
195-
dfly-executable: dragonfly
196-
run-only-on-ubuntu-latest: true
197-
build-folder-name: build
198-
# Non-release build will not run tests marked as slow or opt_only
199-
# "not empty" string is needed for release build because pytest command can not get empty string for filter
200-
filter: ${{ matrix.build-type == 'Release' && 'not empty' || '(not slow) and (not opt_only)' }}
201-
193+
# - name: Run regression tests
194+
# if: matrix.container == 'ubuntu-dev:20'
195+
# uses: ./.github/actions/regression-tests
196+
# with:
197+
# dfly-executable: dragonfly
198+
# run-only-on-ubuntu-latest: true
199+
# build-folder-name: build
200+
# # Non-release build will not run tests marked as slow or opt_only
201+
# # "not empty" string is needed for release build because pytest command can not get empty string for filter
202+
# filter: ${{ matrix.build-type == 'Release' && 'not empty' || '(not slow) and (not opt_only)' }}
203+
#
202204
- name: Upload regression logs on failure
203205
if: failure()
204206
uses: actions/upload-artifact@v4

src/server/cluster_support.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void InitializeCluster() {
7171

7272
if (cluster_mode != ClusterMode::kNoCluster) {
7373
cluster_shard_by_slot = absl::GetFlag(FLAGS_experimental_cluster_shard_by_slot);
74+
LOG(INFO) << "FLAG IS " << cluster_shard_by_slot;
7475
}
7576
}
7677

src/server/multi_test.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ABSL_DECLARE_FLAG(bool, lua_auto_async);
2121
ABSL_DECLARE_FLAG(bool, lua_allow_undeclared_auto_correct);
2222
ABSL_DECLARE_FLAG(std::string, default_lua_flags);
2323
ABSL_DECLARE_FLAG(std::vector<std::string>, lua_force_atomicity_shas);
24+
ABSL_DECLARE_FLAG(bool, experimental_cluster_shard_by_slot);
2425

2526
namespace dfly {
2627

@@ -890,14 +891,16 @@ TEST_F(MultiTest, MultiLeavesTxQueue) {
890891
// tx (mget) after it that runs and tests for atomicity.
891892
absl::FlagSaver fs;
892893
absl::SetFlag(&FLAGS_multi_exec_squash, false);
894+
absl::SetFlag(&FLAGS_experimental_cluster_shard_by_slot, true);
895+
InitializeCluster();
893896

894897
for (unsigned i = 0; i < 20; ++i) {
895898
string key = StrCat("x", i);
896899
LOG(INFO) << key << ": shard " << Shard(key, shard_set->size());
897900
}
898901

899902
Run({"mget", "x5", "x8", "x9", "x13", "x16", "x17"});
900-
ASSERT_EQ(1, GetDebugInfo().shards_count);
903+
ASSERT_EQ(3, GetDebugInfo().shards_count);
901904

902905
auto fb1 = pp_->at(1)->LaunchFiber(Launch::post, [&] {
903906
// Runs multi on shard0 1000 times.

0 commit comments

Comments
 (0)