You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sadanand48 (via GitHub)" <gi...@apache.org> on 2023/06/21 10:26:39 UTC

[GitHub] [ozone] sadanand48 commented on a diff in pull request #4941: HDDS-8885. Quota repair count enable quota feature for old bucket/volume

sadanand48 commented on code in PR #4941:
URL: https://github.com/apache/ozone/pull/4941#discussion_r1236764064


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java:
##########
@@ -190,7 +241,35 @@ private void repairCount() throws Exception {
     }
     LOG.info("Completed quota repair for all keys, files and directories");
   }
-  
+
+  private void updateOldBucketQuotaSupport() {
+    for (Map.Entry<String, OmBucketInfo> entry : nameBucketInfoMap.entrySet()) {
+      if (entry.getValue().getQuotaInBytes() == OLD_QUOTA_DEFAULT
+          || entry.getValue().getQuotaInNamespace() == OLD_QUOTA_DEFAULT) {
+        OmBucketInfo.Builder builder = entry.getValue().toBuilder();
+        if (entry.getValue().getQuotaInBytes() == OLD_QUOTA_DEFAULT) {
+          builder.setQuotaInBytes(QUOTA_RESET);
+        }
+        if (entry.getValue().getQuotaInNamespace() == OLD_QUOTA_DEFAULT) {
+          builder.setQuotaInNamespace(QUOTA_RESET);
+        }
+        OmBucketInfo bucketInfo = builder.build();
+        entry.setValue(bucketInfo);
+        
+        // there is a new value to be updated in bucket cache
+        String bucketKey = metadataManager.getBucketKey(
+            bucketInfo.getVolumeName(), bucketInfo.getBucketName());
+        metadataManager.getBucketTable().addCacheEntry(
+            new CacheKey<>(bucketKey),
+            CacheValue.get(EPOCH_DEFAULT, bucketInfo));

Review Comment:
   The new updated bucketInfo is added to the full table cache here but when does it get committed to the Db?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org