HDDS-16142. Fix double-decrement of deleted-block summary on Ratis timeout - #11043
Merged
Conversation
priyeshkaratha
marked this pull request as ready for review
August 18, 2026 08:32
priyeshkaratha
force-pushed
the
HDDS-16142
branch
from
August 18, 2026 11:25
e0aa5f6 to
5e0fe68
Compare
priyeshkaratha
force-pushed
the
HDDS-16142
branch
from
August 19, 2026 01:19
5e0fe68 to
df28145
Compare
ChenSammi
approved these changes
Aug 19, 2026
Contributor
There was a problem hiding this comment.
Thanks @priyeshkaratha . This is the question that I thought about during HDDS-15726. The change LGTM.
Thanks @smengcl for raising this issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
HDDS-15726 introduced rollback logic that reverts those counters on IOException from addTransactionsToDB / removeTransactionsFromDB. That is correct for definitive failures (not-leader, connection error,
state-machine IO error), but wrong for a Ratis timeout.
SCMRatisServerImpl.submitRequest calls server.submitClientRequestAsync(request).get(requestTimeout, ms)
A TimeoutException from .get() only abandons the client-side wait. The CompletableFuture is discarded, but the in-flight log entry continues through the Ratis pipeline and can still be committed and applied after the caller has already seen the exception. Rolling back the summary at that point produces:
Both divergences persist until the next leader transfer, which reconciles the counters by reloading from the durable state via
initDataDistributionData().
Fix
Introduce isRatisTimeout(IOException) to distinguish ambiguous outcomes from definitive failures. The check covers two cases:
What is the link to the Apache JIRA
HDDS-16142
How was this patch tested?
Tested by added cases and existing tests.