Repository navigation
HDDS-17050. Recon task cursor advances past a batch that failed both attempts, so a restart soon after the failure can lose that batch. - #12093
Draft
ArafatKhan2198 wants to merge 2 commits into
Conversation
…attempts, so a restart soon after the failure can lose that batch.
smengcl
reviewed
Nov 20, 2026
| // waiting would move the task cursor up to the OmDeltaRequest cursor, so a restart before that | ||
| // rebuild would find nothing to redo and the failed batch would be lost. | ||
| if (hasTasksFailed()) { | ||
| LOG.warn("Skipping buffered OM update batch ending at sequence {} because a task has failed and " + |
Contributor
There was a problem hiding this comment.
nit: since this runs once per buffered batch, a backlog in the buffer (tasks slower than the OM sync) would print one WARN per skipped batch until the next sync drains it. The failure is already logged at WARN by the retry path and by the sync thread when it queues the rebuild, so maybe DEBUG is enough here?
Suggested change
| LOG.warn("Skipping buffered OM update batch ending at sequence {} because a task has failed and " + | |
| LOG.debug("Skipping buffered OM update batch ending at sequence {} because a task has failed and " + |
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Hey @smengcl do take a look again |
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?
Sequence
tasksFailed. The rebuild has not started, and the flag lives only in memory.NSSummaryTaskthe namespace summary and du APIs keep reporting too few files and bytes. Later syncs and restarts do not notice. Only a manual rebuild repairs it.New writes before the restart move the OM database position ahead of the task, and startup then does rebuild. The risky window is about one sync interval on a busy cluster, and until the queued rebuild finishes on an idle one.
Change
processOMUpdateBatchreturns immediately whiletasksFailedis set. Batches already waiting are not given to any task, so no saved position moves. This is the same ruleconsumeOMEventsalready uses for batches that arrive after the failure.Skipping them loses nothing. The next sync still drains the buffer and rebuilds from a checkpoint that contains every skipped batch. After a restart, the task position is behind the OM database position, so the existing startup check rebuilds the task and batch 1 is included. Tasks that did not fail pause only until that rebuild is queued.
A task that throws instead of returning a failed result never sets the flag. That case is HDDS-17040 and is not covered here.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17050
How was this patch tested?
testBatchesBehindFailedBatchDoNotAdvanceTaskCursorinTestReconTaskControllerImpl. A task fails a batch ending at sequence 100 on both attempts, which setstasksFailedand leaves its saved position at 0. A later batch ending at 200, which the task would succeed on, is then processed. The position stays at 0 and the task is not called for that batch. Without the change the position becomes 200.mvn -pl :ozone-recon test -Dtest=TestReconTaskControllerImpl -DskipShade -DskipReconThe tests ran successfully.