Repository navigation
HDFS-17985. TestStandbyCheckpoints reads the standby's lastCheckpointTime before the standby has updated it - #8781
Open
joseluisll wants to merge 1 commit into
Open
joseluisll wants to merge 1 commit into
joseluisll wants to merge 1 commit into
Conversation
…Time before the standby has updated it. testLastCheckpointTime waits for the active to hold checkpoint 23, then reads nns[1]'s lastCheckpointTime. nns[2] is an observer and runs no StandbyCheckpointer, so nns[1] is the uploader, and it stamps its own time only after doCheckpoint() returns, which is after the active has already taken the image. The interval can read 0 against an expected 3000. Wait for nns[1] to hold checkpoint 23 and for its time to advance, and wait for the active's time in its own right. Split the combined assertion into two with messages. testPutFsimagePartFailed reads the standby's time the same way and gets the same wait. Split out of HADOOP-19979. Contains content generated by Claude Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎊 +1 overall
This message was automatically generated. |
3 of 6 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required by (waits for this one to be merged):
Description of PR
https://issues.apache.org/jira/browse/HDFS-17985
testLastCheckpointTimewaits for the active NameNode to hold checkpoint 23, then reads the standby'slastCheckpointTime. That wait doesn't guarantee the standby has updated its own time yet:nns[2]is an observer and runs noStandbyCheckpointer, sonns[1]is the only uploader.nns[1]updates itslastCheckpointTimeonly afterdoCheckpoint()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:
nns[1]to hold checkpoint 23 and for itslastCheckpointTimeto advance.lastCheckpointTimeto advance on its own, rather than infer it from the standby.assertTrueinto two, each with a message giving the measured interval.testPutFsimagePartFailedreads 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:
testLastCheckpointTimeexpected: <true> but was: <false>)testPutFsimagePartFailedThe full
TestStandbyCheckpointsclass passes undermvn test(15 tests). Checkstyle reports nothing on the changed lines.For code changes:
declared according to the connector-specific documentation? (N/A)
LICENSE,LICENSE-binary,NOTICE-binaryfiles? (N/A)AI Tooling
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html
Contains content generated by Claude Code.