[ 
https://issues.apache.org/jira/browse/HDDS-12910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wei-Chiu Chuang reassigned HDDS-12910:
--------------------------------------

    Assignee: Wei-Chiu Chuang

> Race condition in TestOMRatisSnapshots.writeKeysToIncreaseLogIndex()
> --------------------------------------------------------------------
>
>                 Key: HDDS-12910
>                 URL: https://issues.apache.org/jira/browse/HDDS-12910
>             Project: Apache Ozone
>          Issue Type: Task
>          Components: OM, Snapshot
>    Affects Versions: 2.1.0
>            Reporter: Wei-Chiu Chuang
>            Assignee: Wei-Chiu Chuang
>            Priority: Minor
>
> [https://github.com/apache/ozone/blob/master/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java#L961]
> h2. Description
> In TestOMRatisSnapshots.java, the helper method writeKeysToIncreaseLogIndex() 
> may outpace the follower OM’s application of Ratis transactions. If the 
> leader OM appends 101 entries but the follower has only applied 100 when we 
> capture its index, the test’s strict “== 100” assertion fails.
> h2. Actual Behavior
> The follower sometimes cases the assertion (which expects exactly +100) to 
> fail.
> h2. Expected Behavior
> The follower’s last-applied index should be treated as “≥ checkpointIndex + 
> 100”, and the test should pass as long as it is at least that high.
> h2. Proposed Fix
> Option A: Block in the test until the follower has applied all writes.
> Example using GenericTestUtils.waitFor:
> {code}
> long targetIndex = leaderCheckpointTermIndex.getIndex() + 100;
> GenericTestUtils.waitFor(() ->
> followerRatisServer.getLastAppliedTermIndex().getIndex() >= targetIndex,  
> 100, 5_000  
> );
> {code}
> Option B: Relax the assertion to allow “≥” rather than “==” when comparing 
> applied transaction count.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to