shuan1026 opened a new pull request, #11329: URL: https://github.com/apache/ozone/pull/11329
### What changes were proposed in this pull request? `testLastRunAnd24hMetrics` intermittently times out after 10s in `waitFor(() -> getDeletedKeyCount() == 20, 100, 10000)` with the count stuck at 10. The test deletes `snap1` and immediately runs `SnapshotDeletingService` synchronously via `runPeriodicalTaskNow()`. `OMSnapshotDeleteRequest` only updates the table cache and stamps the snapshot's `lastTransactionInfo` with the delete transaction; `SnapshotDeletingService.shouldIgnoreSnapshot` then skips the snapshot until that transaction is flushed to RocksDB by the double buffer, logging only at DEBUG level. When the flush has not happened yet, `snap1` is skipped and no `SnapshotPurge` is submitted. The following wait on `snap2` passes vacuously because `snap2` has no new transaction, and the second `KeyDeletingService` run skips `snap2` as already deep cleaned, since only the purge resets that flag. The `Metrics` class configures the three services with a 1h interval and drives them by hand, so nothing retries and the count never reaches 20. The fix is test-only: call `om.awaitDoubleBufferFlush()` between `deleteSnapshot(snap1)` and the `SnapshotDeletingService` run, so the delete is on disk before the service checks it. ### What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16610 ### How was this patch tested? - Deterministic reproduction: temporarily pausing the `OzoneManagerDoubleBuffer` right before `deleteSnapshot(snap1)` and unpausing it 300ms later makes the delete unflushed while `SnapshotDeletingService` runs. Without the fix the test always fails at the `== 20` wait after ~11s with two "has already been deep cleaned. Skipping" lines and no "Started Snapshot Deletion Processing"; with the fix it passes and the log shows the purge and a third `Send 10 key(s) to SCM` batch. The knob is not part of this PR. - full ci: https://github.com/shuan1026/ozone/actions/runs/36208648266 | Ref | Run | Result | | ------------------------------ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | master `571a67a023` (baseline) | [36155791163](https://github.com/shuan1026/ozone/actions/runs/36155791163) | 22/500 iterations failed, all at the `== 20` wait with the signature above | | this change | [36209078308](https://github.com/shuan1026/ozone/actions/runs/36209078308) | 500/500 iterations passed | -- 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]
