ashishkumar50 commented on code in PR #11223:
URL: https://github.com/apache/ozone/pull/11223#discussion_r4022636814


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/BlockID.java:
##########
@@ -147,12 +174,13 @@ public boolean equals(Object o) {
     BlockID blockID = (BlockID) o;
     return this.getContainerBlockID().equals(blockID.getContainerBlockID())
         && this.getBlockCommitSequenceId() == 
blockID.getBlockCommitSequenceId()
-        && Objects.equals(this.getReplicaIndex(), blockID.getReplicaIndex());
+        && Objects.equals(this.getReplicaIndex(), blockID.getReplicaIndex())
+        && Objects.equals(this.getStorageType(), blockID.getStorageType());
   }
 
   @Override
   public int hashCode() {
     return Objects.hash(containerBlockID.getContainerID(), 
containerBlockID.getLocalID(),
-        blockCommitSequenceId, replicaIndex);
+        blockCommitSequenceId, replicaIndex, storageType);

Review Comment:
   Same as above.



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/BlockID.java:
##########
@@ -147,12 +174,13 @@ public boolean equals(Object o) {
     BlockID blockID = (BlockID) o;
     return this.getContainerBlockID().equals(blockID.getContainerBlockID())
         && this.getBlockCommitSequenceId() == 
blockID.getBlockCommitSequenceId()
-        && Objects.equals(this.getReplicaIndex(), blockID.getReplicaIndex());
+        && Objects.equals(this.getReplicaIndex(), blockID.getReplicaIndex())
+        && Objects.equals(this.getStorageType(), blockID.getStorageType());

Review Comment:
   `storageType` is fine to carry as a field — it's useful for the 
datanode-side verification in `verifyStorageType()` — but it must not change 
the notion of what "the same block" means unless storage type is intentionally 
part of BlockID identity.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to