Skip to content

HDDS-16206. Start MiniOzoneCluster Datanodes finalized - #11111

Draft
rjgoyln wants to merge 1 commit into
apache:masterfrom
rjgoyln:HDDS-16206
Draft

HDDS-16206. Start MiniOzoneCluster Datanodes finalized#11111
rjgoyln wants to merge 1 commit into
apache:masterfrom
rjgoyln:HDDS-16206

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 25, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Every Datanode in a mini cluster starts pre-finalized. MiniOzoneCluster pre-creates each Datanode's datanode.id file — HDDS-14812 added that so a Datanode given a synthetic hostname can report an IP address it has no way to resolve, ipAddress being required at registration — and DatanodeLayoutStorage reads a datanode.id file with no VERSION file beside it as an upgrade from an install predating the upgrade framework, defaulting to metadata layout version 0. The Datanode reaches the current version only once SCM orders it to finalize, after it registers.

Master hides this, because SCM finalizes those Datanodes before they can satisfy safemode and tests wait on them. Under ZDU a pre-finalized Datanode is valid for existing operations and no longer holds up safemode exit, so a write meant for a finalized Datanode can land on one that has not finalized yet — the intermittent TestFinalizeBlock failures.

The identity file is now written only for Datanodes that are given a synthetic hostname, with the layout version stamped beside it; every other cluster builds its Datanodes the way a real one does. Tests that want an older layout version set it through UniformDatanodesFactory, which writes the VERSION file itself and takes precedence.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16206

How was this patch tested?

A new parameterized test in TestMiniOzoneCluster builds a cluster with its Datanodes not started and asserts the metadata layout version defaults to the maximum, with and without configured hostnames; both cases fail without the change (expected: <10> but was: <0>).

TestRackAwarePlacement — added with HDDS-14812, covering every rack and hostname combination — and TestDNDataDistributionFinalization pass, as does checkstyle:check on both modules. TestHDDSUpgrade ran out of memory on this machine before finishing, so it is left to CI.

Generated-by: Claude Code (Claude Opus 5)

MiniOzoneCluster wrote a datanode.id file before each Datanode started, so
that a Datanode given a synthetic hostname could report an IP address it
has no way to resolve. A datanode.id file with no VERSION file beside it
means "upgraded from an installation predating the upgrade framework", so
every Datanode came up at metadata layout version 0 and reached the current
version only once SCM ordered it to finalize.

On master SCM finalizes those Datanodes before they can satisfy safemode,
which hides the problem. With ZDU, pre-finalized Datanodes are valid for
all existing operations, so a test that expects finalized Datanodes can be
handed one that has not finalized yet and fails intermittently.
Copilot AI lite review requested due to automatic review settings August 25, 2026 12:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ivandika3

ivandika3 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@hevinhsu could you help to check this when you are available? We have merged HDDS-16018 so technically the workaround in HDDS-14812 that is causing this issue is not needed anymore? Can we revert the workaround instead?

@rjgoyln

rjgoyln commented Aug 25, 2026

Copy link
Copy Markdown
Author

@hevinhsu could you help to check this when you are available? We have merged HDDS-16018 so technically the workaround in HDDS-14812 that is causing this issue is not needed anymore? Can we revert the workaround instead?

Thanks for checking! I actually tried reverting it completely at first, but it caused TestRackAwarePlacement to fail.

It turns out HDDS-14812 introduced two workarounds. While HDDS-16018 fixed the mapping issue, we still need the datanode.id file for tests with synthetic hostnames. Without it, DNS lookups fail, causing a missing ipAddress error (tracked in HDDS-16007).

Therefore, this PR only keeps the file for those specific test cases and cleans up the rest.

@hevinhsu

hevinhsu commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

There are actually two workarounds introduced in HDDS-14812:

  1. Introduce a custom CachedDNSToSwitchMapping to support user-defined hostnames.
  2. Pre-create the datanode.id YAML file to set the hostname/IP for the DN.

HDDS-16018 addressed (1), so we can remove that workaround now(This is now tracked in HDDS-16286).

However, (2) is still needed for tests using synthetic hostnames, and this issue is related to a side effect introduced by (2). So I don't think we can completely revert the workaround from HDDS-14812 yet.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants