Skip to content

RATIS-2677. Replace redundant setFirstRequest() call with an assertion - #1575

Merged
szetszwo merged 1 commit into
apache:masterfrom
lugency:RATIS-2677
Sep 1, 2026
Merged

RATIS-2677. Replace redundant setFirstRequest() call with an assertion#1575
szetszwo merged 1 commit into
apache:masterfrom
lugency:RATIS-2677

Conversation

@lugency

@lugency lugency commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Replace the redundant setFirstRequest() call in OrderedAsync#sendRequestWithRetry() with an assertion. The first-request flag has already been set by SlidingWindow$Client#sendOrDelayRequest() before the request is constructed. The assertion verifies this invariant.

This change also includes the first-request information in the corresponding log representations.

What is the link to the Apache JIRA

RATIS-2677:
In OrderedAsync, setFirstRequest() is not needed.

How was this patch tested?

Tested locally:

  • TestRaftAsyncWithGrpc#testBasicAppendEntriesAsync
  • TestRaftAsyncWithGrpc#testBasicAppendEntriesAsyncKillLeader

@szetszwo szetszwo left a comment

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.

+1 the change looks good.

@szetszwo
szetszwo merged commit 657ab9e into apache:master Sep 1, 2026
16 checks passed
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.

2 participants