Skip to content

Commit 2d6ac63

Browse files
committed
fix bug of isn't work in cascade replication scenario, see #277
1 parent 133ebb1 commit 2d6ac63

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2020-05-06 Alibaba Cloud.
2+
* VERSION: 2.0.2
3+
* BUGFIX: fix bug of `target.db` isn't work in cascade replication
4+
scenario. see #277.
15
2020-05-02 Alibaba Cloud.
26
* VERSION: 2.0.1
37
* IMPROVE: rebase v1.6.28.

src/redis-shake/dbSync/syncIncrease.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,19 @@ func (ds *DbSyncer) parseSourceCommand(reader *bufio.Reader) {
158158
// sendMarkId atomic2.Int64 // sendMarkId is also used as mark the sendId in sender routine
159159
)
160160

161-
// if the start db id != 0, send dbid to the target at first
161+
// if enable target.db
162+
if conf.Options.TargetDB != -1 {
163+
ds.startDbId = conf.Options.TargetDB
164+
}
165+
166+
/*
167+
* if the start db id != 0, send dbid to the target at first.
168+
* there're two cases that the statDbId != 0:
169+
* 1. enable target.db. see #277.
170+
* 2. start from resume-from-break-point
171+
*/
162172
if ds.startDbId != 0 {
163-
log.Infof("last dbid[%v] != 0, send 'select' first", ds.startDbId)
173+
log.Infof("start dbid[%v] != 0, send 'select' first", ds.startDbId)
164174
dbS := fmt.Sprintf("%d", ds.startDbId)
165175
ds.sendBuf <- cmdDetail{
166176
Cmd: "select",

0 commit comments

Comments
 (0)