From c5b3885063cda7ddda8520b237fa3463ecc1c695 Mon Sep 17 00:00:00 2001 From: vinllen Date: Wed, 24 Jul 2019 15:13:40 +0800 Subject: [PATCH] add more debug log in RDB2 --- src/redis-shake/restore.go | 6 +++++- src/redis-shake/sync.go | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/redis-shake/restore.go b/src/redis-shake/restore.go index 1c1f15e..234f807 100644 --- a/src/redis-shake/restore.go +++ b/src/redis-shake/restore.go @@ -158,6 +158,9 @@ func (dr *dbRestorer) restoreRDBFile(reader *bufio.Reader, target []string, auth dr.ignore.Incr() } else { dr.nentry.Incr() + + log.Debugf("routine[%v] try restore key[%s] with value length[%v]", dr.id, e.Key, len(e.Value)) + if conf.Options.TargetDB != -1 { if conf.Options.TargetDB != int(lastdb) { lastdb = uint32(conf.Options.TargetDB) @@ -174,7 +177,8 @@ func (dr *dbRestorer) restoreRDBFile(reader *bufio.Reader, target []string, auth continue } - log.Debugf("routine[%v] restore key[%s] with value length[%v]", dr.id, e.Key, len(e.Value)) + log.Debugf("routine[%v] start restoring key[%s] with value length[%v]", dr.id, e.Key, len(e.Value)) + utils.RestoreRdbEntry(c, e) log.Debugf("routine[%v] restore key[%s] ok", dr.id, e.Key) } diff --git a/src/redis-shake/sync.go b/src/redis-shake/sync.go index 4054a2e..a5a12ef 100644 --- a/src/redis-shake/sync.go +++ b/src/redis-shake/sync.go @@ -414,6 +414,9 @@ func (ds *dbSyncer) syncRDBFile(reader *bufio.Reader, target []string, auth_type ds.ignore.Incr() } else { ds.nentry.Incr() + + log.Debugf("dbSyncer[%v] try restore key[%s] with value length[%v]", ds.id, e.Key, len(e.Value)) + if conf.Options.TargetDB != -1 { if conf.Options.TargetDB != int(lastdb) { lastdb = uint32(conf.Options.TargetDB) @@ -438,9 +441,11 @@ func (ds *dbSyncer) syncRDBFile(reader *bufio.Reader, target []string, auth_type continue } } - log.Debugf("dbSyncer[%v] restore key[%s] with value length[%v]", ds.id, e.Key, len(e.Value)) + + log.Debugf("dbSyncer[%v] start restoring key[%s] with value length[%v]", ds.id, e.Key, len(e.Value)) + utils.RestoreRdbEntry(c, e) - log.Debugf("routine[%v] restore key[%s] ok", ds.id, e.Key) + log.Debugf("dbSyncer[%v] restore key[%s] ok", ds.id, e.Key) } } }()