-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-9884. Pass DatanodeVersion to the client #6155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks @smengcl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @smengcl for working on this.
The proto part looks good, but I think we should improve the tests (and the part added in production code to enable testing).
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java
Outdated
Show resolved
Hide resolved
This PR will need to rebase, sorry. |
Conflicts: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvement @smengcl
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java
Show resolved
Hide resolved
...gration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java
Show resolved
Hide resolved
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
Outdated
Show resolved
Hide resolved
Can this information be deduced from the Service Info that the client establishes? Unless we want mixed version Datanodes (mixed set of Datanodes finalized post upgrade), I don't see why we need to add more load to the protocol executed for every read. |
@kerneltime Do you mean Also on the DN side, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this is good
@@ -132,12 +135,14 @@ public class MiniOzoneClusterImpl implements MiniOzoneCluster { | |||
private CertificateClient caClient; | |||
private final Set<AutoCloseable> clients = ConcurrentHashMap.newKeySet(); | |||
private SecretKeyClient secretKeyClient; | |||
private static MockedStatic mockDNStatic = Mockito.mockStatic(HddsDatanodeService.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doc https://www.baeldung.com/mockito-mock-static-methods
recommends to enclose MockedStatic in a try block to avoid side effects that impacts other tests.
I think it's fine for this case though because we usually just have one mini cluster.
Merged. Thanks @smengcl for the PR and @kerneltime @errose28 @adoroszlai for the reviews. |
What changes were proposed in this pull request?
DatanodeDetails
hasinitialVersion
andcurrentVersion
(DatanodeVersion
, not to be confused withHDDSLayoutFeature
) added since HDDS-4730 but they were never passed to the client. The core of this PR is just to add both fields to the proto message and make sure they are correctly serded and passed to the client.To be used by HDDS-9752 (#5663) or its follow-up patch in order to make sure new clients would still work with old datanodes over the wire.
currentVersion
proto field to be passed from DN to a client.Note:
initialVersion
field has been intentionally skipped since it is of no use to the client.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9884
How was this patch tested?
HddsDatanodeService
andMiniOzoneCluster
in order to facilitate that.