[ 
https://issues.apache.org/jira/browse/HDDS-6418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501667#comment-17501667
 ] 

Attila Doroszlai edited comment on HDDS-6418 at 3/5/22, 5:31 AM:
-----------------------------------------------------------------

[~pifta],

bq. Can you elaborate why it should send the clientversion?

It is not about sending client version.  Datanode builds the response based on 
that version number:

{code}
  public HddsProtos.DatanodeDetailsProto toProto(int clientVersion) {
    return toProtoBuilder(clientVersion).build();
  }


  public HddsProtos.DatanodeDetailsProto.Builder toProtoBuilder(
      int clientVersion) {
    ...

    final boolean handlesUnknownPorts =
        clientVersion >= VERSION_HANDLES_UNKNOWN_DN_PORTS;
    for (Port port : ports) {
      if (handlesUnknownPorts || Name.V0_PORTS.contains(port.getName())) {
        builder.addPorts(port.toProto());
{code}

If client is at version 0 and datanode at version 1, client cannot handle 
unknown ports.  But here datanode will include replication port in DN details 
proto, based on its own version=1.

I think that specific situation is not possible, because usageinfo command did 
not exist at client version=0.  But the same could happen if we introduced a 
new pair of client and datanode versions.


was (Author: adoroszlai):
[~pifta],

If client is at version 0 and datanode at version 1, client cannot handle 
unknown ports.  But here datanode will include replication port in DN details 
proto, based on its own version=1.

I think that specific situation is not possible, because usageinfo command did 
not exist at client version=0.  But the same could happen if we introduced a 
new pair of client and datanode versions.

Client version should be used at server-side to determine what behavior the 
client can tolerate, which data structures it can accept.  That's why we 
include it in the request.

> Datanode usage info uses wrong version number
> ---------------------------------------------
>
>                 Key: HDDS-6418
>                 URL: https://issues.apache.org/jira/browse/HDDS-6418
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: SCM
>    Affects Versions: 1.1.0
>            Reporter: Attila Doroszlai
>            Priority: Major
>
> {{DatanodeUsageInfo}} passes _datanode_ version 
> ({{datanodeDetails.getCurrentVersion()}}) to the {{toProto}} method instead 
> of _client_ version.
> {code:title=https://github.com/apache/ozone/blob/fe6f060d8983462a717f6588dff257f4a6da86c4/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeUsageInfo.java#L187-L201}
>   private HddsProtos.DatanodeUsageInfoProto.Builder toProtoBuilder() {
>     HddsProtos.DatanodeUsageInfoProto.Builder builder =
>         HddsProtos.DatanodeUsageInfoProto.newBuilder();
>     if (datanodeDetails != null) {
>       builder.setNode(
>           datanodeDetails.toProto(datanodeDetails.getCurrentVersion()));
>     }
>     if (scmNodeStat != null) {
>       builder.setCapacity(scmNodeStat.getCapacity().get());
>       builder.setUsed(scmNodeStat.getScmUsed().get());
>       builder.setRemaining(scmNodeStat.getRemaining().get());
>     }
>     return builder;
>   }
> {code}
> CC [~siddhantsangwan], [~ljain]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to