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

   ## What changes were proposed in this pull request?
   Fixed two race conditions in 
TestKeyDeletingService$RequestBatching#testPurgeKeysRequestBatching that caused 
intermittent 
   1. Removed background thread interference 
   2. Ensured deleted keys are visible in RocksDB before the service runs 
   3. Removed the @Flaky("HDDS-13661") annotation
   
   Please describe your PR in detail:
   The test testPurgeKeysRequestBatching validates that KeyDeletingService 
correctly batches PurgeKeysRequests to stay within the Ratis byte limit 
(introduced by HDDS-13517). It creates and deletes 50 keys, then triggers the 
service manually via runPeriodicalTaskNow(), asserting that all 50 keys are 
purged across the captured batches.
   
   Root cause 1 — background thread race:
   In the intermittent failure scenario, the background thread could pick up 
all 50 keys but only submit 7 of the 8 batches before getAllValues() is called, 
while the 8th batch (containing the 50th key) is still in-flight. The fix sets 
OZONE_BLOCK_DELETING_SERVICE_INTERVAL to 1 day so the background thread never 
fires during the test window.
   Root cause 2 — DoubleBuffer visibility:
   inserts om.awaitDoubleBufferFlush() after createAndDeleteKeys() but before 
resume(), ensuring all 50 entries are committed to RocksDB before the service 
runs.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-13661
   
   ## How was this patch tested?
   
   - The flaky test was reproduced locally (intermittent expected: <50> but 
was: <49>) before the fix was applied.
   - After the fix, the test was stress-run 20 consecutive times using a local 
stress-run script (run-flaky-test.sh) with no failures:
   <img width="900" height="574" alt="image" 
src="https://github.com/user-attachments/assets/043aaaaf-5565-4e79-bec9-b56d42a34bc2";
 />
   


-- 
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