@@ -1638,7 +1638,7 @@ private void waitingAllSnapshotsFinished() {
16381638 snapshotFinishedTime = System .currentTimeMillis ();
16391639 state = RestoreJobState .DOWNLOAD ;
16401640
1641- env .getEditLog ().logRestoreJob (this );
1641+ env .getEditLog ().logRestoreJob (this , null );
16421642 LOG .info ("finished making snapshots. {}" , this );
16431643 return ;
16441644 }
@@ -1981,7 +1981,7 @@ private void waitingAllDownloadFinished() {
19811981 // backupMeta is useless now
19821982 backupMeta = null ;
19831983
1984- env .getEditLog ().logRestoreJob (this );
1984+ env .getEditLog ().logRestoreJob (this , null );
19851985 LOG .info ("finished to download. {}" , this );
19861986 }
19871987
@@ -2036,6 +2036,7 @@ private Status allTabletCommitted(boolean isReplay) {
20362036 return new Status (ErrCode .NOT_FOUND , "database " + dbId + " does not exist" );
20372037 }
20382038
2039+ RestoreBinLogInfo restoreBinLogInfo = new RestoreBinLogInfo (dbId , db .getName ());
20392040 // replace the origin tables in atomic.
20402041 if (isAtomicRestore ) {
20412042 Status st = atomicReplaceOlapTables (db , isReplay );
@@ -2052,6 +2053,9 @@ private Status allTabletCommitted(boolean isReplay) {
20522053 if (tbl == null ) {
20532054 continue ;
20542055 }
2056+ //just restore existing table, then version will change.
2057+ // so we need to write bin log for those tables also.
2058+ restoreBinLogInfo .addTableInfo (tbl .getId (), tbl .getName ());
20552059 OlapTable olapTbl = (OlapTable ) tbl ;
20562060 if (!tbl .writeLockIfExist ()) {
20572061 continue ;
@@ -2097,6 +2101,7 @@ private Status allTabletCommitted(boolean isReplay) {
20972101 }
20982102
20992103 if (!isReplay ) {
2104+ restoredTbls .stream ().forEach (tbl -> restoreBinLogInfo .addTableInfo (tbl .getId (), tbl .getName ()));
21002105 restoredPartitions .clear ();
21012106 restoredTbls .clear ();
21022107 restoredResources .clear ();
@@ -2111,7 +2116,7 @@ private Status allTabletCommitted(boolean isReplay) {
21112116 finishedTime = System .currentTimeMillis ();
21122117 state = RestoreJobState .FINISHED ;
21132118
2114- env .getEditLog ().logRestoreJob (this );
2119+ env .getEditLog ().logRestoreJob (this , restoreBinLogInfo );
21152120 }
21162121
21172122 LOG .info ("job is finished. is replay: {}. {}" , isReplay , this );
@@ -2383,7 +2388,7 @@ private void cancelInternal(boolean isReplay) {
23832388 finishedTime = System .currentTimeMillis ();
23842389 state = RestoreJobState .CANCELLED ;
23852390 // log
2386- env .getEditLog ().logRestoreJob (this );
2391+ env .getEditLog ().logRestoreJob (this , null );
23872392
23882393 LOG .info ("finished to cancel restore job. current state: {}. is replay: {}. {}" ,
23892394 curState .name (), isReplay , this );
0 commit comments