This is an automated email from the ASF dual-hosted git repository.
chungen0126 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new c379bcc4478 HDDS-16133. Make TestReconTasks EMPTY_MISSING check
deterministic (#11059)
c379bcc4478 is described below
commit c379bcc447848da73b591219a464ea455f281708
Author: Y-C <[email protected]>
AuthorDate: Mon Aug 24 08:52:02 2026 +0800
HDDS-16133. Make TestReconTasks EMPTY_MISSING check deterministic (#11059)
---
.../java/org/apache/hadoop/ozone/recon/TestReconTasks.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
index f847812edcd..4d9f802aee3 100644
---
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
+++
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
@@ -340,9 +340,8 @@ public void
testContainerHealthTaskDetectsUnderReplicatedAfterNodeFailure()
* <p>Classification logic: When a CLOSING container has zero replicas,
* {@code ClosingContainerHandler} samples it as {@code MISSING}. Then
* {@code handleMissingContainer()} calls {@code isEmptyMissing()} which
checks
- * {@link ContainerInfo#getNumberOfKeys()}. Since the container was created
via
- * XceiverClient bypassing Ozone Manager, SCM's key count is 0, so the
container
- * is classified as {@code EMPTY_MISSING} rather than {@code MISSING}.</p>
+ * {@link ContainerInfo#getNumberOfKeys()}. Since no block is written,
container reports keep the key
+ * count at 0, so Recon classifies the container as {@code EMPTY_MISSING}
rather than {@code MISSING}.</p>
*
* <p>Note: this test relies on the CLOSING-state path (not the CLOSED-state
path),
* so no explicit container close is needed before node shutdown. The
dead-node
@@ -365,8 +364,11 @@ public void
testContainerHealthTaskDetectsEmptyMissingWhenAllReplicasLost()
long containerID = containerInfo.getContainerID();
Pipeline pipeline =
scmPipelineManager.getPipeline(containerInfo.getPipelineID());
+ // Do NOT write a block here: container reports propagate the datanode's
block count into
+ // ContainerInfo#numberOfKeys, and a non-zero key count yields MISSING
instead of EMPTY_MISSING.
XceiverClientGrpc client = new XceiverClientGrpc(pipeline, conf);
- runTestOzoneContainerViaDataNode(containerID, client);
+ client.connect();
+ createContainerForTesting(client, containerID);
// Wait for Recon to receive the container report from the single datanode.
// This ensures DeadNodeHandler can find and remove the replica when the
node dies.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]