rjgoyln opened a new pull request, #11111: URL: https://github.com/apache/ozone/pull/11111
## 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) -- 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]
