Skip to content

HDDS-16044. SCM should forward Datanode's current version to clients for read and write operations - #11023

Draft
errose28 wants to merge 8 commits into
apache:HDDS-14496-zdufrom
errose28:scm-version-passthrough
Draft

HDDS-16044. SCM should forward Datanode's current version to clients for read and write operations#11023
errose28 wants to merge 8 commits into
apache:HDDS-14496-zdufrom
errose28:scm-version-passthrough

Conversation

@errose28

Copy link
Copy Markdown
Contributor

DRAFT Builds on #11006

What changes were proposed in this pull request?

HDDS-16154 has Datanode's select their current version to send to clients based on whether or not they are finalized for ZDU and can use the unified versioning framework. SCM must pass this version through in the Pipeline + DatanodeDetails objects given to clients for read and write operations to datanodes. Prior to this, the current version assigned by the datanodes represented their software version, which was static as long as the process was running with the same software.

The complication with this change is that SCM currently stores Datanode metadata in three places:

  • Persisted in PipelineManager
    • Only assigned on pipeline creation and never updated afterwards
  • In-memory in NodeManager
    • Always has the most up to date information from the last heartbeat
  • In-memory as replicas in ContainerManager
    • Happens to have the most up to date information because replicas hold references to the same objects in NodeManager

For write operations and reads from open containers, SCM was sourcing currentVersion from the persisted PipelineManager metadata. Prior to ZDU, this would return outdated version information for pipelines that remained after an upgrade when Datanode version increased. With ZDU this will also be a problem since the currentVersion will be updated on finalization.

For read operations from closed containers, it was sourcing currentVersion from the container replicas in ContainerManager. The ContainerManager replicas happened to have references to the NodeManager DatanodeInfo objects so they were returning up to date information, although there is nothing enforcing that this will remain true going forward.

To account for these issues, this PR substitutes the currentVersion from NodeManager at the time of serialization in the translator layers before returning the information back to the client. This avoids any invasive changes to the storage schema and any extra copies to update immutable objects like Pipeline. The downside is that it must be inserted into every operation that returns DatanodeDetails to the client, although the surface area is small. Currently this is:

  • ScmBlockLocationProtocolServerSideTranslatorPB#allocateScmBlock
  • StorageContainerLocationProtocolServerSideTranslatorPB#allocateContainer, #getContainerWithPipeline, #getContainerWithPipelineBatch, #getExistContainerWithPipelinesInBatch
    • Read requests, all datanode currentVersions can be forwarded exactly.
    • All read requests return a ContainerWithPipeline object.
      • ContainerWithPipeline#getProtobuf has been updated to require an explicit version be provided for each replica by the caller, ensuring all read requests are covered.

What is the link to the Apache JIRA

HDDS-16044

How was this patch tested?

  • Unit test added for each API in the translator layers responsible for forwarding the version information.
  • Integration test added for end to end testing that all current versions sent by the datanode end up at the client for the matrix of read/write+EC/Ratis+open/closed containers.

…or all components

(cherry picked from commit 1718018c67f8535f701f4493fd7e8d73478e5d61)
DN's reported current version is source of truth
DN is not yet passing updated current version to SCM
SCM is not yet updating all references to current version

(cherry picked from commit 12fee8f97b9395dfc2147885a11a503ee00ecb91)

Conflicts:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/pipeline/Pipeline.java
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/ScmBlockLocationProtocolServerSideTranslatorPB.java
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/protocol/TestScmBlockLocationProtocolServerSideTranslatorPB.java

(cherry picked from commit df960170e56105ba348c27beac9334ba7065ddb0)
(cherry picked from commit 34a9ae215bfb6787efcae90b6149a275f3318a33)
…o pass

(cherry picked from commit 7385bf00c776001bd10044e658d655d422702fec)
@errose28 errose28 added the zdu Pull requests for Zero Downtime Upgrade (ZDU) https://issues.apache.org/jira/browse/HDDS-14496 label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zdu Pull requests for Zero Downtime Upgrade (ZDU) https://issues.apache.org/jira/browse/HDDS-14496

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant