@@ -284,12 +284,14 @@ func (r *PhysRestore) doFullCleanup() error {
284
284
if err != nil {
285
285
return errors .Wrapf (err , "flush dbpath %s" , r .dbpath )
286
286
}
287
- return nil
287
+
288
+ // cleanup went file, bug full cleanup represents error in case of restore
289
+ return errors .New ("full cleanup applyed" )
288
290
}
289
291
290
292
// doFallbackCleanup is node's cleanup strategy for recovering dbpath
291
293
// from fallbacksync dir.
292
- // Mark cluster with fallback error.
294
+ // It marks cluster with fallback error.
293
295
func (r * PhysRestore ) doFallbackCleanup () error {
294
296
r .log .Warning ("apply fallback cleanup strategy: using db data from %s" , fallbackDir )
295
297
err := r .migrateFromFallbackDirToDBDir ()
@@ -300,11 +302,11 @@ func (r *PhysRestore) doFallbackCleanup() error {
300
302
if r .nodeInfo .IsClusterLeader () {
301
303
err = r .MarkAsFallback ()
302
304
if err != nil {
303
- return errors . Wrap ( err , "mark meta as fallback" )
305
+ r . log . Warning ( "mark meta as fallback: %v" , err )
304
306
}
305
307
}
306
308
307
- // cleanup went file, bug follback represents error in case of restore
309
+ // cleanup went file, bug fallback represents error in case of restore
308
310
return errors .New ("fallback applyed" )
309
311
}
310
312
@@ -1299,6 +1301,14 @@ func (r *PhysRestore) Snapshot(
1299
1301
1300
1302
stat , err := r .toState (defs .StatusDone )
1301
1303
if err != nil {
1304
+ if r .nodeInfo .IsLeader () {
1305
+ // before returning try to create meta
1306
+ r .log .Info ("writing restore meta" )
1307
+ merr := r .dumpMeta (meta , stat , "" )
1308
+ if merr != nil {
1309
+ r .log .Warning ("writing restore meta to storage: %v" , merr )
1310
+ }
1311
+ }
1302
1312
return errors .Wrapf (err , "moving to state %s" , defs .StatusDone )
1303
1313
}
1304
1314
0 commit comments