smengcl commented on a change in pull request #2857:
URL: https://github.com/apache/ozone/pull/2857#discussion_r755666056
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java
##########
@@ -48,6 +48,19 @@
private long quotaInNamespace;
private long usedNamespace;
private List<OzoneAcl> acls;
+ /**
+ * Reference count on this Ozone volume.
+ *
+ * When reference count is larger than zero, it indicates that at least one
+ * "lock" is held on the volume by some Ozone feature (e.g. multi-tenancy).
+ * Volume delete operation will be denied in this case, and user should be
+ * prompted to release the lock first via the interface provided by that
+ * feature.
+ *
+ * Volumes created using CLI, ObjectStore API or upgraded from older OM DB
+ * will have reference count set to zero by default.
+ */
+ private long refCount;
Review comment:
Good catch.
tho btw the current broken impl still works, refCount is set directly
through `omVolumeArgs.setRefCount(1L)` and persisted to the `VolumeTable`.
`ozone tenant create vol1` first, then `ozone sh volume delete vol1` should
throw. Such issue could be caught in client-server communication, which we have
not implemented so far.
--
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]