Skip to content

Commit

Permalink
Disable swapdb tests with flash
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Mar 8, 2024
1 parent d84fa52 commit 559588b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2724,6 +2724,14 @@ static int isValidProcTitleTemplate(char *val, const char **err) {
return 1;
}

static int isValidDisklessEnum(int e, const char **err) {
if (e == REPL_DISKLESS_LOAD_SWAPDB && g_pserver->m_pstorageFactory != nullptr) {
*err = "cannot use swapdb with a storage provider";
return 0;
}
return 1;
}

static int updateProcTitleTemplate(char *val, char *prev, const char **err) {
UNUSED(val);
UNUSED(prev);
Expand Down Expand Up @@ -3091,7 +3099,7 @@ standardConfig configs[] = {
/* Enum Configs */
createEnumConfig("supervised", NULL, IMMUTABLE_CONFIG, supervised_mode_enum, cserver.supervised_mode, SUPERVISED_NONE, NULL, NULL),
createEnumConfig("syslog-facility", NULL, IMMUTABLE_CONFIG, syslog_facility_enum, g_pserver->syslog_facility, LOG_LOCAL0, NULL, NULL),
createEnumConfig("repl-diskless-load", NULL, MODIFIABLE_CONFIG, repl_diskless_load_enum, g_pserver->repl_diskless_load, REPL_DISKLESS_LOAD_DISABLED, NULL, NULL),
createEnumConfig("repl-diskless-load", NULL, MODIFIABLE_CONFIG, repl_diskless_load_enum, g_pserver->repl_diskless_load, REPL_DISKLESS_LOAD_DISABLED, isValidDisklessEnum, NULL),
createEnumConfig("loglevel", NULL, MODIFIABLE_CONFIG, loglevel_enum, cserver.verbosity, LL_NOTICE, NULL, NULL),
createEnumConfig("maxmemory-policy", NULL, MODIFIABLE_CONFIG, maxmemory_policy_enum, g_pserver->maxmemory_policy, MAXMEMORY_NO_EVICTION, NULL, NULL),
createEnumConfig("appendfsync", NULL, MODIFIABLE_CONFIG, aof_fsync_enum, g_pserver->aof_fsync, AOF_FSYNC_EVERYSEC, NULL, NULL),
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/replication-psync-flash.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ if {$::flash_enabled} {

foreach mdl {no yes} {
foreach sdl {disabled swapdb} {
if {$::flash_enabled && $sdl == "swapdb"} {
continue
}

test_psync {no reconnection, just sync} 6 1000000 3600 0 {
} $mdl $sdl 0

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/replication-psync-multimaster.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond mdl sdl reco

foreach mdl {no yes} {
foreach sdl {disabled swapdb} {
if {$::flash_enabled && $sdl == "swapdb"} {
continue
}

test_psync {no reconnection, just sync} 6 1000000 3600 0 {
} $mdl $sdl 0

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/replication-psync.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond mdl sdl reco

foreach mdl {no yes} {
foreach sdl {disabled swapdb} {
if {$::flash_enabled && $sdl == "swapdb"} {
continue
}

test_psync {no reconnection, just sync} 6 1000000 3600 0 {
} $mdl $sdl 0

Expand Down
9 changes: 8 additions & 1 deletion tests/integration/replication.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ start_server {tags {"repl"}} {

foreach mdl {no yes} {
foreach sdl {disabled swapdb} {
if {$::flash_enabled && $sdl == "swapdb"} {
# swapdb not compatible with flash
continue
}
start_server {tags {"repl"}} {
set master [srv 0 client]
$master config set repl-diskless-sync $mdl
Expand Down Expand Up @@ -383,6 +387,7 @@ start_server {tags {"repl"}} {
}
}

if {!$::flash_enabled} {
test {slave fails full sync and diskless load swapdb recovers it} {
start_server {tags {"repl"}} {
set slave [srv 0 client]
Expand Down Expand Up @@ -547,6 +552,7 @@ test {diskless loading short read} {
}
}
}
}

# get current stime and utime metrics for a thread (since it's creation)
proc get_cpu_metrics { statfile } {
Expand Down Expand Up @@ -578,7 +584,7 @@ proc compute_cpu_usage {start end} {
return [ list $pucpu $pscpu ]
}


if {!$::flash_enabled} {
# test diskless rdb pipe with multiple replicas, which may drop half way
start_server {tags {"repl"}} {
set master [srv 0 client]
Expand Down Expand Up @@ -814,6 +820,7 @@ test "diskless replication read pipe cleanup" {
}
}
}
}

test {replicaof right after disconnection} {
# this is a rare race condition that was reproduced sporadically by the psync2 unit.
Expand Down

0 comments on commit 559588b

Please sign in to comment.