diff --git a/graphql/admin/restore.go b/graphql/admin/restore.go index 354a72d463d..3eac81e41a9 100644 --- a/graphql/admin/restore.go +++ b/graphql/admin/restore.go @@ -22,6 +22,7 @@ import ( "sync" "github.com/dgraph-io/dgraph/edgraph" + "github.com/golang/glog" "github.com/dgraph-io/dgraph/graphql/resolve" "github.com/dgraph-io/dgraph/graphql/schema" @@ -54,6 +55,9 @@ func resolveRestore(ctx context.Context, m schema.Mutation) (*resolve.Resolved, if err != nil { return resolve.EmptyResult(m, err), false } + glog.Infof("Got restore request with location: %s, id: %s, num: %d, incrementalFrom: %d,"+ + "isPartial: %v", input.Location, input.BackupId, input.BackupNum, input.IncrementalFrom, + input.IsPartial) req := pb.RestoreRequest{ Location: input.Location, diff --git a/worker/online_restore.go b/worker/online_restore.go index 7c53b22ea6b..e4df6494901 100644 --- a/worker/online_restore.go +++ b/worker/online_restore.go @@ -231,9 +231,10 @@ func tryRestoreProposal(ctx context.Context, req *pb.RestoreRequest) error { for i := 0; i < 10; i++ { err = proposeRestoreOrSend(ctx, req) if err == nil { + glog.Info("proposeRestoreOrSend done.") return nil } - + glog.Errorf("Got error while proposeRestoreOrSend: %v, will retry...\n", err) if retriableRestoreError(err) { time.Sleep(time.Second) continue @@ -256,6 +257,7 @@ func (w *grpcWorker) Restore(ctx context.Context, req *pb.RestoreRequest) (*pb.S return nil, errors.Wrapf(err, "cannot wait for restore ts %d", req.RestoreTs) } + glog.Infof("Proposing restore request") err := groups().Node.proposeAndWait(ctx, &pb.Proposal{Restore: req}) if err != nil { return &emptyRes, errors.Wrapf(err, errRestoreProposal) @@ -424,12 +426,14 @@ func handleRestoreProposal(ctx context.Context, req *pb.RestoreRequest, pidx uin go func(idx uint64) { n := groups().Node if !n.AmLeader() { + glog.Infof("I am not leader, not proposing snapshot.") return } if err := n.Applied.WaitForMark(context.Background(), idx); err != nil { glog.Errorf("Error waiting for mark for index %d: %+v", idx, err) return } + glog.Infof("I am the leader. Proposing snapshot after restore.") if err := n.proposeSnapshot(); err != nil { glog.Errorf("cannot propose snapshot after processing restore proposal %+v", err) } diff --git a/worker/restore_map.go b/worker/restore_map.go index cc76400cb4b..2bdd0bde6d1 100644 --- a/worker/restore_map.go +++ b/worker/restore_map.go @@ -790,8 +790,8 @@ func RunMapper(req *pb.RestoreRequest, mapDir string) (*mapResult, error) { } maxBannedNs = x.Max(maxBannedNs, ns) } - glog.Infof("[MAP] Processed manifest %d\n", manifest.BackupNum) } + glog.Infof("[MAP] Processed manifest num: %d\n", manifest.BackupNum) } // done with all the manifests. glog.Infof("Histogram of map input sizes:\n%s\n", mapper.szHist)