Skip to content

Commit 8b4daae

Browse files
committed
chore: reproduce MultiLeavesTxQueue fails on multi-shard
Signed-off-by: kostas <kostas@dragonflydb.io>
1 parent 70be62c commit 8b4daae

File tree

3 files changed

+55
-50
lines changed

3 files changed

+55
-50
lines changed

.github/workflows/ci.yml

+50-49
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,61 @@ 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+
./multi_test
158+
159+
160+
# - name: C++ Unit Tests - Epoll
161+
# run: |
162+
# cd ${GITHUB_WORKSPACE}/build
163+
#
164+
# # Create a rule that automatically prints stacktrace upon segfault
165+
# cat > ./init.gdb <<EOF
166+
# catch signal SIGSEGV
167+
# command
168+
# bt
169+
# end
170+
# EOF
171+
#
172+
# gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll
173+
# 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
174+
#
175+
# FLAGS_fiber_safety_margin=4096 FLAGS_force_epoll=true timeout 5m ./allocation_tracker_test
176+
#
177+
# - name: C++ Unit Tests - IoUring with cluster mode
178+
# run: |
179+
# FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated timeout 20m ctest -V -L DFLY
180+
#
181+
# - name: C++ Unit Tests - IoUring with cluster mode and FLAGS_lock_on_hashtags
182+
# run: |
183+
# FLAGS_fiber_safety_margin=4096 FLAGS_cluster_mode=emulated FLAGS_lock_on_hashtags=true timeout 20m ctest -V -L DFLY
184+
#
184185
- name: Upload unit logs on failure
185186
if: failure()
186187
uses: actions/upload-artifact@v4
187188
with:
188189
name: unit_logs
189190
path: /tmp/*INFO*
190191

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

src/server/cluster_support.cc

+1
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

+4-1
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)