Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(restore): add more logs for restore request (#8050) #8975

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore(restore): add more logs for restore request (#8050)
  • Loading branch information
mangalaman93 committed Aug 25, 2023
commit 21f15485303b1592c4d0de9fba3aedbc92ba5080
2 changes: 2 additions & 0 deletions graphql/admin/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func resolveRestore(ctx context.Context, m schema.Mutation) (*resolve.Resolved,
if err != nil {
return resolve.EmptyResult(m, err), false
}
glog.Infof("Got restore request, location: %v, backupId: %v, backupNum: %v, incrementalFrom: %d, isPartial: %v",
input.Location, input.BackupId, input.BackupNum, input.IncrementalFrom, input.IsPartial)

req := pb.RestoreRequest{
Location: input.Location,
Expand Down
6 changes: 5 additions & 1 deletion worker/online_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,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, retrying!", err)
if retriableRestoreError(err) {
time.Sleep(time.Second)
continue
Expand All @@ -229,6 +230,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)
Expand Down Expand Up @@ -415,12 +417,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)
}
Expand Down
2 changes: 1 addition & 1 deletion worker/restore_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,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: %v", manifest.BackupNum)
} // done with all the manifests.

glog.Infof("Histogram of map input sizes:\n%s\n", mapper.szHist)
Expand Down