Skip to content

Commit

Permalink
Disable swapdb with flash since it doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Mar 8, 2024
1 parent c83c55f commit ad2a282
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7436,6 +7436,11 @@ static void validateConfiguration()
exit(EXIT_FAILURE);
}

if (g_pserver->repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB && g_pserver->m_pstorageFactory) {
serverLog(LL_WARNING, "SWAPDB is not implemented when using a storage provider.");
exit(EXIT_FAILURE);
}

g_pserver->repl_backlog_size = g_pserver->repl_backlog_config_size; // this is normally set in the update logic, but not on initial config
}

Expand Down
10 changes: 10 additions & 0 deletions tests/cluster/run.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ source ../../support/cluster.tcl ; # Redis Cluster client.
set ::instances_count 20 ; # How many instances we use at max.
set ::tlsdir "../../tls"

# Check if we compiled with flash
set status [catch {exec ../../../src/keydb-server --is-flash-enabled}]
if {$status == 0} {
puts "KeyDB was built with FLASH, including FLASH tests"
set ::flash_enabled 1
} else {
puts "KeyDB was not built with FLASH. Excluding FLASH tests"
set ::flash_enabled 0
}

proc main {} {
parse_options
spawn_instance redis $::redis_base_port $::instances_count {
Expand Down
2 changes: 2 additions & 0 deletions tests/cluster/tests/17-diskless-load-swapdb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test "Cluster is writable" {
cluster_write_test 0
}

if {!$::flash_enabled} {
test "Right to restore backups when fail to diskless load " {
set master [Rn 0]
set replica [Rn 1]
Expand Down Expand Up @@ -84,3 +85,4 @@ test "Right to restore backups when fail to diskless load " {
assert_equal {1} [$replica get $slot0_key]
assert_equal $slot0_key [$replica CLUSTER GETKEYSINSLOT 0 1] "POST RUN"
}
}

0 comments on commit ad2a282

Please sign in to comment.