Skip to content

HDFS-17985. TestStandbyCheckpoints reads the standby's lastCheckpointTime before the standby has updated it - #8781

Open
joseluisll wants to merge 1 commit into
apache:trunkfrom
joseluisll:HDFS-17985
Open

joseluisll wants to merge 1 commit into
apache:trunkfrom
joseluisll:HDFS-17985

Conversation

@joseluisll

@joseluisll joseluisll commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Required by (waits for this one to be merged):

Description of PR

https://issues.apache.org/jira/browse/HDFS-17985

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:

  • 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? (N/A)
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files? (N/A)

AI Tooling

If an AI tool was used:

Contains content generated by Claude Code.

…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>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 27m 9s trunk passed
+1 💚 compile 0m 58s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 1m 7s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 1m 5s trunk passed
+1 💚 mvnsite 1m 2s trunk passed
+1 💚 javadoc 1m 4s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 59s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 2m 32s trunk passed
+1 💚 shadedclient 20m 0s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 47s the patch passed
+1 💚 compile 0m 43s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 43s the patch passed
+1 💚 compile 0m 46s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 0m 46s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 53s the patch passed
+1 💚 mvnsite 0m 58s the patch passed
+1 💚 javadoc 0m 40s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 39s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 2m 18s the patch passed
+1 💚 shadedclient 19m 16s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 184m 36s hadoop-hdfs in the patch passed.
+1 💚 asflicense 0m 31s The patch does not generate ASF License warnings.
267m 50s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8781/1/artifact/out/Dockerfile
GITHUB PR #8781
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 0091aaa23521 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 0dc1e97
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8781/1/testReport/
Max. process+thread count 3524 (vs. ulimit of 10000)
modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8781/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants