Skip to content

Commit

Permalink
meta: add warning for binary dump from Redis and databases
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Dec 29, 2024
1 parent 2e734c9 commit 6fa7893
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/meta/redis_bak.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (m *redisMeta) dumpCounters(ctx Context, opt *DumpOption, ch chan<- *dumped
}

func (m *redisMeta) dumpMix(ctx Context, opt *DumpOption, ch chan<- *dumpedResult) error {
logger.Warnf("please make sure the redis server is readonly, otherwise the dumped metadata will be inconsistent")
pools := map[int][]*sync.Pool{
segTypeNode: {{New: func() interface{} { return &pb.Node{} }}},
segTypeEdge: {{New: func() interface{} { return &pb.Edge{} }}},
Expand Down
3 changes: 3 additions & 0 deletions pkg/meta/sql_bak.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func (m *dbMeta) dump(ctx Context, opt *DumpOption, ch chan<- *dumpedResult) err
}
defer sess.Rollback() //nolint:errcheck
ctx.WithValue(txSessionKey{}, sess)
} else {
logger.Warnf("dump database with %d threads, please make sure that it's readonly, "+
"otherwise the dumped metadata will be inconsistent", opt.Threads)
}
for _, f := range dumps {
err := f(ctx, opt, ch)
Expand Down

0 comments on commit 6fa7893

Please sign in to comment.