Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dual-channel-replication Feature Flag's Protection #908

Merged
merged 6 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3074,7 +3074,7 @@ standardConfig static_configs[] = {
createBoolConfig("lazyfree-lazy-user-flush", NULL, DEBUG_CONFIG | MODIFIABLE_CONFIG, server.lazyfree_lazy_user_flush, 0, NULL, NULL),
createBoolConfig("repl-disable-tcp-nodelay", NULL, MODIFIABLE_CONFIG, server.repl_disable_tcp_nodelay, 0, NULL, NULL),
createBoolConfig("repl-diskless-sync", NULL, DEBUG_CONFIG | MODIFIABLE_CONFIG, server.repl_diskless_sync, 1, NULL, NULL),
createBoolConfig("dual-channel-replication-enabled", NULL, DEBUG_CONFIG | MODIFIABLE_CONFIG | PROTECTED_CONFIG, server.dual_channel_replication, 0, NULL, NULL),
createBoolConfig("dual-channel-replication-enabled", NULL, DEBUG_CONFIG | MODIFIABLE_CONFIG, server.dual_channel_replication, 0, NULL, NULL),
createBoolConfig("aof-rewrite-incremental-fsync", NULL, MODIFIABLE_CONFIG, server.aof_rewrite_incremental_fsync, 1, NULL, NULL),
createBoolConfig("no-appendfsync-on-rewrite", NULL, MODIFIABLE_CONFIG, server.aof_no_fsync_on_rewrite, 0, NULL, NULL),
createBoolConfig("cluster-require-full-coverage", NULL, MODIFIABLE_CONFIG, server.cluster_require_full_coverage, 1, NULL, NULL),
Expand Down
58 changes: 58 additions & 0 deletions tests/integration/dual-channel-replication.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ start_server {tags {"dual-channel-replication external:skip"}} {

test "Toggle dual-channel-replication-enabled: $enable start" {
populate 1000 primary 10000
$primary config set rdb-key-save-delay 0
set prev_sync_full [s 0 sync_full]
set prev_sync_partial [s 0 sync_partial_ok]

Expand Down Expand Up @@ -251,6 +252,63 @@ start_server {tags {"dual-channel-replication external:skip"}} {
}
$replica replicaof no one
}

foreach test_instance {primary replica} {
$primary config set dual-channel-replication-enabled $enable
$replica config set dual-channel-replication-enabled $enable
test "Online toggle dual-channel-replication-enabled: $enable start, toggle on $test_instance" {
naglera marked this conversation as resolved.
Show resolved Hide resolved
populate 1000 primary 10000
$primary config set rdb-key-save-delay 100000

$replica replicaof $primary_host $primary_port
# wait for sync to start
if {$enable == "yes"} {
wait_for_condition 500 1000 {
[string match "*slave*,state=wait_bgsave*,type=rdb-channel*" [$primary info replication]] &&
[string match "*slave*,state=bg_transfer*,type=main-channel*" [$primary info replication]] &&
[s 0 rdb_bgsave_in_progress] eq 1
} else {
fail "replica didn't start sync session in time"
naglera marked this conversation as resolved.
Show resolved Hide resolved
}
} else {
wait_for_condition 500 1000 {
[string match "*slave*,state=wait_bgsave*,type=replica*" [$primary info replication]] &&
[s 0 rdb_bgsave_in_progress] eq 1
} else {
fail "replica didn't start sync session in time"
naglera marked this conversation as resolved.
Show resolved Hide resolved
}
}
# Toggle config
set new_value "yes"
if {$enable == "yes"} {
set new_value "no"
}
set instance $primary
if {$test_instance == "replica"} {
set instnace $replica
naglera marked this conversation as resolved.
Show resolved Hide resolved
}
$instance config set dual-channel-replication-enabled $new_value
# Wait for at least one server cron
after 1
naglera marked this conversation as resolved.
Show resolved Hide resolved

if {$enable == "yes"} {
# Verify that dual channel replication sync is still in progress
assert [string match "*slave*,state=wait_bgsave*,type=rdb-channel*" [$primary info replication]]
assert [string match "*slave*,state=bg_transfer*,type=main-channel*" [$primary info replication]]
assert {[s 0 rdb_bgsave_in_progress] eq 1}
} else {
# Verify that normal sync is still in progress
assert [string match "*slave*,state=wait_bgsave*,type=replica*" [$primary info replication]]
assert {[s 0 rdb_bgsave_in_progress] eq 1}
}
$replica replicaof no one
wait_for_condition 500 1000 {
[s -1 rdb_bgsave_in_progress] eq 0
} else {
fail "Primary should abort sync"
}
}
}
}
}
}
Expand Down
Loading