[
https://issues.apache.org/jira/browse/HDDS-16987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130507#comment-18130507
]
Siyao Meng commented on HDDS-16987:
-----------------------------------
[Jira cleanup 2026-10-22] Resolving as Fixed. Lease recovery tests close the
container holding the stream's last block.
Evidence:
*
https://github.com/apache/ozone/commit/8838cb79972d8a52ad693ab190d2640084a1174a
*
https://github.com/apache/ozone/blob/bf3829e6c8ac69ae17585585703f91426dcdf6b3/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java#L577
Feel free to reopen if further work is needed.
> Intermittent failure in TestLeaseRecovery#testGetCommittedBlockLength*
> ----------------------------------------------------------------------
>
> Key: HDDS-16987
> URL: https://issues.apache.org/jira/browse/HDDS-16987
> Project: Apache Ozone
> Issue Type: Sub-task
> Components: test
> Reporter: Siyao Meng
> Assignee: Siyao Meng
> Priority: Major
> Labels: pull-request-available
>
> {{TestLeaseRecovery#testGetCommittedBlockLengthTimeout}} and
> {{#testGetCommittedBlockLengthWithException}} fail on the first run in almost
> every {{integration (flaky)}} job, and pass on the rerun. In the last 214
> master runs (2026-09-20 to 2026-10-14), every job needed a rerun of
> {{TestLeaseRecovery}}:
> {code}
> TestLeaseRecovery.testGetCommittedBlockLengthTimeout(boolean)[1]
> closeIgnoringOMException:119 expected: <KEY_UNDER_LEASE_RECOVERY> but was:
> <KEY_NOT_FOUND>
> TestLeaseRecovery.testGetCommittedBlockLengthTimeout(boolean)[2]
> testGetCommittedBlockLengthTimeout:386 expected: <3> but was: <0>
> TestLeaseRecovery.testGetCommittedBlockLengthWithException
> testGetCommittedBlockLengthWithException:435 expected: <2> but was: <1>
> {code}
> {{closeLatestContainer()}} closes the last container returned by
> {{ContainerManager#getContainers}}, assuming it holds the block just written
> by the test. That only holds on a fresh cluster. After earlier test methods
> have run, SCM has several open containers across pipelines, and the block is
> often allocated to a different one. The test then closes an unrelated
> pipeline, the block's pipeline stays open, and lease recovery finalizes the
> block through {{FinalizeBlock}} instead of falling back to
> {{GetCommittedBlockLength}}, so the assertions on {{GetCommittedBlockLength}}
> fail. The rerun passes because it starts a new cluster and runs only the
> failed methods.
> Fix: close the container of the last block written by the test's output
> stream.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]