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

[ISSUE #6285] Polish the DLedgerControllerStateMachine log output to help troubleshoot #6286

Merged
merged 1 commit into from
Mar 9, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,20 @@ public DLedgerControllerStateMachine(final ReplicasInfoManager replicasInfoManag
@Override
public void onApply(CommittedEntryIterator iterator) {
int applyingSize = 0;
long firstApplyIndex = -1;
long lastApplyIndex = -1;
while (iterator.hasNext()) {
final DLedgerEntry entry = iterator.next();
final byte[] body = entry.getBody();
if (body != null && body.length > 0) {
final EventMessage event = this.eventSerializer.deserialize(body);
this.replicasInfoManager.applyEvent(event);
}
firstApplyIndex = firstApplyIndex == -1 ? entry.getIndex() : firstApplyIndex;
lastApplyIndex = entry.getIndex();
applyingSize++;
}
log.info("Apply {} events on controller {}", applyingSize, this.dLedgerId);
log.info("Apply {} events index from {} to {} on controller {}", applyingSize, firstApplyIndex, lastApplyIndex, this.dLedgerId);
}

@Override
Expand All @@ -69,7 +73,6 @@ public boolean onSnapshotLoad(SnapshotReader reader) {
return false;
}


@Override
public void onShutdown() {
}
Expand Down