@@ -231,9 +231,10 @@ func tryRestoreProposal(ctx context.Context, req *pb.RestoreRequest) error {
231
231
for i := 0 ; i < 10 ; i ++ {
232
232
err = proposeRestoreOrSend (ctx , req )
233
233
if err == nil {
234
+ glog .Info ("proposeRestoreOrSend done." )
234
235
return nil
235
236
}
236
-
237
+ glog . Errorf ( "Got error while proposeRestoreOrSend: %v, will retry... \n " , err )
237
238
if retriableRestoreError (err ) {
238
239
time .Sleep (time .Second )
239
240
continue
@@ -256,6 +257,7 @@ func (w *grpcWorker) Restore(ctx context.Context, req *pb.RestoreRequest) (*pb.S
256
257
return nil , errors .Wrapf (err , "cannot wait for restore ts %d" , req .RestoreTs )
257
258
}
258
259
260
+ glog .Infof ("Proposing restore request" )
259
261
err := groups ().Node .proposeAndWait (ctx , & pb.Proposal {Restore : req })
260
262
if err != nil {
261
263
return & emptyRes , errors .Wrapf (err , errRestoreProposal )
@@ -424,12 +426,14 @@ func handleRestoreProposal(ctx context.Context, req *pb.RestoreRequest, pidx uin
424
426
go func (idx uint64 ) {
425
427
n := groups ().Node
426
428
if ! n .AmLeader () {
429
+ glog .Infof ("I am not leader, not proposing snapshot." )
427
430
return
428
431
}
429
432
if err := n .Applied .WaitForMark (context .Background (), idx ); err != nil {
430
433
glog .Errorf ("Error waiting for mark for index %d: %+v" , idx , err )
431
434
return
432
435
}
436
+ glog .Infof ("I am the leader. Proposing snapshot after restore." )
433
437
if err := n .proposeSnapshot (); err != nil {
434
438
glog .Errorf ("cannot propose snapshot after processing restore proposal %+v" , err )
435
439
}
0 commit comments