You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "priyeshkaratha (via GitHub)" <gi...@apache.org> on 2026/08/18 08:27:33 UTC
[PR] HDDS-16142. Fix double-decrement of deleted-block summary on Ratis timeout [ozone]
priyeshkaratha opened a new pull request, #11043:
URL: https://github.com/apache/ozone/pull/11043
## 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:
- a double-decrement on the add path (summary goes negative), or
- an overcount on the remove path (summary stays inflated).
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:
- SCMException(ResultCodes.TIMEOUT): translateException maps a java.util.concurrent.TimeoutException to this code.
- SCMException(ResultCodes.INTERNAL_ERROR) whose cause is InterruptedException: .get() can also throw InterruptedException if the thread is interrupted while waiting; the request is already in-flight, giving the same ambiguous outcome as a timeout.
## What is the link to the Apache JIRA
HDDS-16142
## How was this patch tested?
Tested by added cases and existing tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-16142. Fix double-decrement of deleted-block summary on Ratis timeout [ozone]
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi merged PR #11043:
URL: https://github.com/apache/ozone/pull/11043
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org