anuragp010 commented on code in PR #11399:
URL: https://github.com/apache/ozone/pull/11399#discussion_r4338808008
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerReplica.java:
##########
@@ -150,6 +150,19 @@ public StorageType getVolumeStorageType() {
return volumeStorageType;
}
+ /**
+ * The storage type a copy of this replica should be placed on to stay on the
+ * same tier. Prefers the volume the replica actually lives on, since that is
+ * ground truth, and falls back to the type the container was created for.
+ *
+ * @return the storage type to target, or null when neither was reported,
which
+ * leaves the target free to choose any volume
+ */
+ @Nullable
+ public StorageType getTargetStorageTypeForCopy() {
+ return volumeStorageType != null ? volumeStorageType : storageType;
+ }
Review Comment:
`getTargetStorageTypeForCopy()` prefers `volumeStorageType` and falls back
to `storageType`. After a volume relabel, the two can differ. `storageType` is
the intended type on which the container was created. Is `volumeStorageType`
preferred here because the node usage stats are also computed per volume?
--
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]