-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-11351. Unify protobuf definition of StorageType #7109
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
Conversation
|
@szetszwo, @devabhishekpal Could you help to review this? |
|
There are some compatibility issues If we upgrade the protobuf version from 2.5.0 to 2.6.1, this may introduce some risks, so let we keep the protobuf version unchanged. |
szetszwo
left a comment
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.
@xichen01 , thanks for working on this! Please see my suggestions inlined.
| ZERO = 0; // Invalid Factor | ||
| } | ||
|
|
||
| enum StorageType { |
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.
To avoid confusing with org.apache.hadoop.hdds.protocol.StorageType, let's use StorageTypeProto?
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.
Both hdds.proto and ScmServerDatanodeHeartbeatProtocol.proto are package hadoop.hdds; so we cannot name it to StorageTypeProto
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.
Since they are in the same package, we could safely move the StorageTypeProto from ScmServerDatanodeHeartbeatProtocol.proto to hdds.proto. The only difference is the java_outer_classname. Fortunately, ScmServerDatanodeHeartbeatProtocol.proto is a non-user facing internal protocol and the change is wire compatible. So there is no compatibility issues. See https://issues.apache.org/jira/secure/attachment/13075616/7109_review.patch
BTW, let's rename ScmServerDatanodeHeartbeatProtocol.proto to StorageContainerDatanodeProtocol.proto, i.e. make it consistent with the java_outer_classname.
| optional uint64 scmUsed = 4 [default = 0]; | ||
| optional uint64 remaining = 5 [default = 0]; | ||
| optional StorageTypeProto storageType = 6 [default = DISK]; | ||
| optional StorageTypeProto storageType = 6 [default = DISK, deprecated = true]; |
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.
It seems to be safe to just replace StorageTypeProto with Hdds.StorageTypeProto.
We should test it.
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 your suggestion, I think this is compatibility, but the maven plugin proto-backwards-compatibility will report error say the "field CONFLICT".
And the plugin proto-backwards-compatibility not support to ignore a specific field.
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.
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 will also cause proto-backwards-compatibility to report an error. It seems that it is difficult for us to change the existing proto message
[INFO] --- proto-backwards-compatibility:1.0.7:backwards-compatibility-check (default) @ hdds-interface-server ---
[INFO] protolock cmd line: /Users/xichen/community/ozone/hadoop-hdds/interface-server/target/protolock-bin/protolock status --lockdir=/Users/xichen/community/ozone/hadoop-hdds/interface-server/target/classes --protoroot=/Users/xichen/community/ozone/hadoop-hdds/interface-server/target/classes
[INFO] CONFLICT: "StorageTypeProto" field: "ARCHIVE" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" field: "DISK" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" field: "PROVIDED" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" field: "RAM_DISK" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" field: "SSD" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" integer: "1" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" integer: "2" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" integer: "3" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" integer: "4" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]
[INFO] CONFLICT: "StorageTypeProto" integer: "5" has been removed, but is not reserved [ScmServerDatanodeHeartbeatProtocol.proto]# Conflicts: # hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java # pom.xml
|
@szetszwo PTAL. |
|
@xichen01 , could you take my previous review comments #7109 (review) ? |
szetszwo
left a comment
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.
@xichen01 , thanks for taking a look. I have some suggestions. Please see the comments inlined.
| ZERO = 0; // Invalid Factor | ||
| } | ||
|
|
||
| enum StorageType { |
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.
Since they are in the same package, we could safely move the StorageTypeProto from ScmServerDatanodeHeartbeatProtocol.proto to hdds.proto. The only difference is the java_outer_classname. Fortunately, ScmServerDatanodeHeartbeatProtocol.proto is a non-user facing internal protocol and the change is wire compatible. So there is no compatibility issues. See https://issues.apache.org/jira/secure/attachment/13075616/7109_review.patch
BTW, let's rename ScmServerDatanodeHeartbeatProtocol.proto to StorageContainerDatanodeProtocol.proto, i.e. make it consistent with the java_outer_classname.
| optional uint64 scmUsed = 4 [default = 0]; | ||
| optional uint64 remaining = 5 [default = 0]; | ||
| optional StorageTypeProto storageType = 6 [default = DISK]; | ||
| optional StorageTypeProto storageType = 6 [default = DISK, deprecated = true]; |
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.
|
@xichen01 , Currently, we are voting 2.0.0. How about getting this in 2.0.0? Then, we can legitimately update the Cc @jojochuang , @adoroszlai |
It looks fine to me, and if we do it, do we need to modify both proto field and |
I believe the answer is yes, although it is not mentioned in the release guideline Could you update this PR? We should get this merged soon. |
| DISK_TYPE = 1; | ||
| SSD_TYPE = 2; | ||
| ARCHIVE_TYPE = 3; | ||
| RAM_DISK_TYPE = 4; | ||
| PROVIDED_TYPE = 5; |
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.
I don't recall who, but back in HDFS land after storage policy feature was implemented, someone (Arpit or Anu?) regrettably said it was a mistake to have these types continuous, because it wasn't possible to add any storage types in between. It might be a good idea to space them out.
@szetszwo do you recall?
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.
I also don't recall.
... it was impossible to insert any new storage types in between. ...
Not really -- we may use 1.1 if there is a need.
Also, why it has to insert in between? We may put the new policy at the end. I don't think Storage policy has a total ordering.
| repeated OzoneAclInfo acls = 3; | ||
| required bool isVersionEnabled = 4 [default = false]; | ||
| required StorageTypeProto storageType = 5 [default = DISK]; | ||
| optional StorageTypeProto storageType = 5 [default = DISK, deprecated = true]; |
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.
is this change from required to optional backward compatible?
Imagine a new OM server and an old client. The new server omits this field while client expects this field. Wouldn't the client fail to parse?
| /** | ||
| * Ozone specific storage types. | ||
| */ | ||
| @Deprecated |
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.
is it really deprecated? If so, what replaces it?
|
@jojochuang , please review #8208 instead. We have a slightly different approach now. @xichen01 , let's close this in order to avoid confusion? |
|
Superseded by 8208. |
What changes were proposed in this pull request?
Unify protobuf definition of storageType.
Context
hdds.proto.hdds.proto, so we should to define storageType enum inhdds.protoModifications
Upgradeproto2.hadooprpc.protobuf.versionform 2.5.0 to 2.6.1, the proto 2.6.1 start supports the enumdeprecatedsyntax.ScmServerDatanodeHeartbeatProtocol.proto#StorageTypeProtoandOmClientProtocol.proto#StorageTypeProtoasdeprecated = true.hdds.proto#StorageType, and replaceScmServerDatanodeHeartbeatProtocol.proto#StorageTypeProto, and restrict import ofScmServerDatanodeHeartbeatProtocol(by maven pluginrestrict-imports-enforcer-rule)The
OmBucketInfo#storageTypewill be removed in the future, because Buckets should not have aStorageTypefield, and should useStoragePolicyinstead ofStorageTypeCompatibility
StorageLocationReport,StorageTypeis only used inUsageMetrics. Version changes may cause this indicator to be inaccurate, but it will not affect the main business process.ScmServerDatanodeHeartbeatProtocol#StorageTypeProto.storageType(id 2) default value is DISK, so deprecate it will not cause NPE issuesWhat is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11351
How was this patch tested?
existing test.