File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -2069,7 +2069,6 @@ void readSyncBulkPayload(connection *conn) {
2069
2069
*
2070
2070
* 2. Or when we are done reading from the socket to the RDB file, in
2071
2071
* such case we want just to read the RDB file in memory. */
2072
- serverLog (LL_NOTICE, " MASTER <-> REPLICA sync: Flushing old data" );
2073
2072
2074
2073
/* We need to stop any AOF rewriting child before flusing and parsing
2075
2074
* the RDB, otherwise we'll create a copy-on-write disaster. */
@@ -2089,7 +2088,10 @@ void readSyncBulkPayload(connection *conn) {
2089
2088
* (Where disklessLoadMakeBackups left server.db empty) because we
2090
2089
* want to execute all the auxiliary logic of emptyDb (Namely,
2091
2090
* fire module events) */
2092
- emptyDb (-1 ,empty_db_flags,replicationEmptyDbCallback);
2091
+ if (!fUpdate ) {
2092
+ serverLog (LL_NOTICE, " MASTER <-> REPLICA sync: Flushing old data" );
2093
+ emptyDb (-1 ,empty_db_flags,replicationEmptyDbCallback);
2094
+ }
2093
2095
2094
2096
/* Before loading the DB into memory we need to delete the readable
2095
2097
* handler, otherwise it will get called recursively since
Original file line number Diff line number Diff line change @@ -237,3 +237,18 @@ start_server {tags {"active-repl"} overrides {active-replica yes}} {
237
237
}
238
238
}
239
239
}
240
+
241
+ start_server {tags {" active-repl" } overrides {active-replica yes}} {
242
+ set slave [srv 0 client]
243
+ set slave_host [srv 0 host]
244
+ set slave_port [srv 0 port]
245
+ start_server {tags {" active-repl" } overrides { active-replica yes}} {
246
+ r set testkeyB bar
247
+ test {Active Replica Merges Database On Sync} {
248
+ $slave set testkeyA foo
249
+ r replicaof $slave_host $slave_port
250
+ after 1000
251
+ assert_equal 2 [r dbsize]
252
+ }
253
+ }
254
+ }
You can’t perform that action at this time.
0 commit comments