joseluisll commented on code in PR #8717:
URL: https://github.com/apache/hadoop/pull/8717#discussion_r3947050082
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java:
##########
@@ -764,13 +764,29 @@ public void testLastCheckpointTime() throws Exception {
nns[0].getRpcServer().rollEditLog();
HATestUtil.waitForCheckpoint(cluster, 0, ImmutableList.of(23));
+ // The wait above only says the active holds the new image. Every standby
+ // builds its own checkpoint and any of them may be the one that uploaded
+ // it, and the one that did stamps its own lastCheckpointTime only once
+ // doCheckpoint() has returned. So nns[1] can still be reporting the
+ // previous checkpoint here, which reads as an interval of zero. Wait for
+ // its time to move before taking the pair. The active stamps its own
+ // while it receives the upload, inside that same doCheckpoint(), so by
+ // then it has necessarily moved too.
+ GenericTestUtils.waitFor(
Review Comment:
Added waitForCheckpoint(cluster, 1, [23]). Being precise about what it buys:
the image is saved inside doCheckpoint() and the stamp happens after it
returns, so a read between the two still sees the old stamp — the anchor
narrows the window rather than closing it. The assertion holds regardless,
since a tick only stamps once the period has elapsed and 1000 txns is out of
reach for nine edits. Took the 4-arg waitFor; it takes a String built at call
time, so the message carries the baseline but not the value seen at timeout.
--
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]