diff --git a/src/replication.c b/src/replication.c index 14241c79e..d4ea0aa6d 100644 --- a/src/replication.c +++ b/src/replication.c @@ -5002,6 +5002,10 @@ int shouldStartChildReplication(int *mincapa_out, int *req_out) { continue; } idle = server.unixtime - slave->lastinteraction; + /* If the slave requests a slots snapshot, we should start BGSAVE + * immediately since it can't share the RDB with other slaves. */ + if (slave->slave_req & SLAVE_REQ_SLOTS_SNAPSHOT) + idle = server.repl_diskless_sync_delay; /* Threshold for BGSAVE */ if (idle > max_idle) max_idle = idle; slaves_waiting++; mincapa = first ? slave->slave_capa : (mincapa & slave->slave_capa); diff --git a/tests/unit/cluster/atomic-slot-migration.tcl b/tests/unit/cluster/atomic-slot-migration.tcl index 6c398ccc5..f04257fe5 100644 --- a/tests/unit/cluster/atomic-slot-migration.tcl +++ b/tests/unit/cluster/atomic-slot-migration.tcl @@ -2630,10 +2630,6 @@ start_cluster 3 6 [list tags {external:skip cluster modules} config_lines [list # restart node 4 if {$with_rdb eq "with"} { restart_server -4 true false true save ;# rdb save - # the asm task info in rdb will fire module event - assert_equal [list \ - "sub: cluster-slot-migration-import-started, source_node_id:$src_id, destination_node_id:$dest_id, task_id:$task_id, slots:0-100" \ - ] [R 4 asm.get_cluster_event_log] } else { restart_server -4 true false true nosave ;# no rdb saved }