Issue #64 RREPLAY isn't binary safe. Add fix and test.

Former-commit-id: afe66288fe9df6d8247d459e57858430f1ec7a25
This commit is contained in:
John Sully 2019-07-24 22:31:02 -04:00
parent 2df14dc997
commit f31b1fd06b
2 changed files with 10 additions and 1 deletions

View File

@ -3277,7 +3277,7 @@ void replicaReplayCommand(client *c)
cFake->lock.lock();
cFake->authenticated = c->authenticated;
cFake->puser = c->puser;
cFake->querybuf = sdscat(cFake->querybuf,(sds)ptrFromObj(c->argv[2]));
cFake->querybuf = sdscatsds(cFake->querybuf,(sds)ptrFromObj(c->argv[2]));
selectDb(cFake, c->db->id);
processInputBuffer(cFake, (CMD_CALL_FULL & (~CMD_CALL_PROPAGATE)));
cFake->lock.unlock();

View File

@ -49,6 +49,15 @@ start_server {tags {"active-repl"} overrides {active-replica yes}} {
}
}
test {Active replicas propogate binary} {
$master set binkey "\u0000foo"
wait_for_condition 50 500 {
[string match *foo* [$slave get binkey]]
} else {
fail "replication failed to propogate binary data"
}
}
test {Active replicas WAIT} {
# Test that wait succeeds since replicas should be syncronized
$master set testkey foo