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
Draft
HDDS-16044. SCM should forward Datanode's current version to clients for read and write operations#11023errose28 wants to merge 8 commits into
errose28 wants to merge 8 commits into
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
PipelineManagerNodeManagerContainerManagerNodeManagerFor write operations and reads from open containers, SCM was sourcing
currentVersionfrom the persistedPipelineManagermetadata. 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 thecurrentVersionwill be updated on finalization.For read operations from closed containers, it was sourcing
currentVersionfrom the container replicas inContainerManager. TheContainerManagerreplicas happened to have references to theNodeManagerDatanodeInfoobjects 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
currentVersionfromNodeManagerat 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 likePipeline. The downside is that it must be inserted into every operation that returnsDatanodeDetailsto the client, although the surface area is small. Currently this is:ScmBlockLocationProtocolServerSideTranslatorPB#allocateScmBlockStorageContainerLocationProtocolServerSideTranslatorPB#allocateContainer, #getContainerWithPipeline, #getContainerWithPipelineBatch, #getExistContainerWithPipelinesInBatchcurrentVersions can be forwarded exactly.ContainerWithPipelineobject.ContainerWithPipeline#getProtobufhas 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?