joseluisll opened a new pull request, #8781: URL: https://github.com/apache/hadoop/pull/8781
### Description of PR https://issues.apache.org/jira/browse/HDFS-17985 Split out of HADOOP-19979 (#8717). Unchanged from the version reviewed there. `testLastCheckpointTime` waits for the active NameNode to hold checkpoint 23, then reads the standby's `lastCheckpointTime`. That wait doesn't guarantee the standby has updated its own time yet: - `nns[2]` is an observer and runs no `StandbyCheckpointer`, so `nns[1]` is the only uploader. - `nns[1]` updates its `lastCheckpointTime` only after `doCheckpoint()` returns. By then the active has already received the image. So the test can read the standby's previous time and see an interval of 0 against an expected 3000. The fix: - Wait for `nns[1]` to hold checkpoint 23 and for its `lastCheckpointTime` to advance. - Wait for the active's `lastCheckpointTime` to advance on its own, rather than infer it from the standby. - Split the combined `assertTrue` into two, each with a message giving the measured interval. - `testPutFsimagePartFailed` reads the standby's time the same way, so it gets the same wait. Test-only change, one file. ### How was this patch tested? OpenJDK 21, both tests run together 20 times: | Test | trunk | patch | |---|---|---| | `testLastCheckpointTime` | 3 failures (`expected: <true> but was: <false>`) | 0 failures | | `testPutFsimagePartFailed` | 1 failure (same) | 0 failures | | Runs fully green | 16/20 | 20/20 | The full `TestStandbyCheckpoints` class passes under `mvn test` (15 tests). Checkstyle reports nothing on the changed lines. ### For code changes: - [x] Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? - [ ] Object storage: Have the integration tests been executed and the endpoint declared according to the connector-specific documentation? *(N/A)* - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? *(N/A)* - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? *(N/A)* ### AI Tooling If an AI tool was used: - [x] The PR includes the phrase "Contains content generated by <tool>" where <tool> is the name of the AI tool used. - [x] My use of AI contributions follows the ASF legal policy https://www.apache.org/legal/generative-tooling.html Contains content generated by Claude Code. -- 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]
