ss77892 opened a new pull request, #10959:
URL: https://github.com/apache/ozone/pull/10959

   ## What changes were proposed in this pull request?
   Flaky TestOMRatisSnapshots#testInstallSnapshotWithClientWrite: follower may 
not have all keys when the leader's last applied index is reached
   
   The test starts a stopped follower OM, writes 200 keys while it catches up, 
waits for the follower to reach the leader, then reads the follower's RocksDB 
directly to confirm every key arrived. Sometimes the last few keys aren't there 
yet. That happens because there is a small gap in which a write has already 
been acked to the client (and committed to the Ratis log) but not yet flushed 
to RocksDB. The test relies on the leader's lastAppliedTermIndex, which only 
advances on flush, so the target it hands the follower can sit behind writes 
that already returned. Previously, a 5-second sleep made the flush all but 
certain by the time that index was read. HDDS-10310 replaced it with an 
index-based wait and dropped the per-key sleeps from the write loop, so the 
writes now outrun the flush and nothing closes the gap, leaving the test to 
check the follower's DB for keys that are still queued. 
   The fix adds a single leaderOM.awaitDoubleBufferFlush() call after the 
writes complete, so the leader's lastAppliedTermIndex covers them before the 
test uses it as the follower's target.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16081
   
   ## How was this patch tested?
   To reproduce it for sure, a small delay (10ms) has been added to 
OzoneManagerDoubleBuffer#flush. The test fails all the time in this case. With 
the fix, it no longer fails. 


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to