Skip to content

RATIS-2508. appendEntries log messages improvement.#1440

Open
szetszwo wants to merge 3 commits intoapache:masterfrom
szetszwo:RATIS-2508
Open

RATIS-2508. appendEntries log messages improvement.#1440
szetszwo wants to merge 3 commits intoapache:masterfrom
szetszwo:RATIS-2508

Conversation

@szetszwo
Copy link
Copy Markdown
Contributor

@szetszwo szetszwo commented Apr 25, 2026

See RATIS-2508

Due to checkstyle line number limit (2000), this PR also refactors RaftServerImpl.

@szetszwo szetszwo requested a review from adoroszlai April 27, 2026 16:50
Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for the patch.

Comment on lines +105 to +106
: n == 1 ? "entry" + first
: n + " entries:" + first + "..." + last;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing :?

Suggested change
: n == 1 ? "entry" + first
: n + " entries:" + first + "..." + last;
: n == 1 ? "entry:" + first
: n + " entries:" + first + "..." + last;

Also, would = instead of : be better? Since AppendEntriesRequest#toString uses : as separator.

return JavaUtils.getClassSimpleName(getClass())
+ ":cid=" + callId
+ ":" + toLogEntryTermIndexString(entriesCount, firstEntry, lastEntry);

Comment on lines +1700 to +1702
LOG.warn("{}: appendEntries* failed: {}", getMemberId(), toLogEntryTermIndexString(entries), t);
} else if (LOG.isDebugEnabled()) {
LOG.debug("{}: appendEntries* succeeded {}", getMemberId(), toLogEntryTermIndexString(entries));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: failed: {} has : but succeeded {} does not.

@szetszwo
Copy link
Copy Markdown
Contributor Author

@adoroszlai , thanks for reviewing this! Just pushed a change to address your comments.

Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for updating the patch, LGTM.

Copy link
Copy Markdown
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~ Only a minor problem

if (roleChangeChecking(electionTimeout)) {
LOG.info("{}: change to CANDIDATE, lastRpcElapsedTime:{}, electionTimeout:{}",
this, lastRpcTime.elapsedTime(), electionTimeout);
LOG.info("{}: change to CANDIDATE, lastRpcElapsedTime:{}ms, electionTimeout:{}",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we add ms for lastRpcElapsedTime but not electionTimeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants