[BugFix] adjust star mgr journal replay log (backport #62374) (#62401)

Signed-off-by: starrocks-xupeng <xupeng@starrocks.com>
Co-authored-by: starrocks-xupeng <xupeng@starrocks.com>
This commit is contained in:
mergify[bot] 2025-08-28 03:11:44 +00:00 committed by GitHub
parent f4ee640fc7
commit e6d48b7a86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 6 deletions

View File

@ -200,6 +200,7 @@ public class StarOSBDBJEJournalSystem implements JournalSystem {
long startReplayId = replayedJournalId.get();
long startTime = System.currentTimeMillis();
while (true) {
long innerStartTime = System.currentTimeMillis();
JournalEntity entity = cursor.next();
// EOF or aggressive retry
@ -209,16 +210,19 @@ public class StarOSBDBJEJournalSystem implements JournalSystem {
editLog.loadJournal(null /* GlobalStateMgr */, entity);
replayedJournalId.incrementAndGet();
long innerEndTime = System.currentTimeMillis();
LOG.debug("star mgr journal {} replayed.", replayedJournalId);
if (innerEndTime - innerStartTime > 3000) {
LOG.info("star mgr journal replay id:{} op:{} cost {}ms.", replayedJournalId, entity.opCode(),
innerEndTime - innerStartTime);
}
}
long cost = System.currentTimeMillis() - startTime;
if (cost >= 1000) {
LOG.warn("star mgr replay journal cost too much time: {} replayedJournalId: {}.", cost, replayedJournalId);
}
if (replayedJournalId.get() - startReplayId > 0) {
LOG.info("star mgr replayed journal from {} to {}.", startReplayId, replayedJournalId);
long count = replayedJournalId.get() - startReplayId;
if (count > 0) {
LOG.info("star mgr replayed journal from {} to {}, count {}, cost {}ms.", startReplayId, replayedJournalId,
count, cost);
return true;
}
return false;