glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

EC: handle statfs with simple-quota

Open amarts opened this issue 3 years ago • 2 comments

this should be similar to deem-statfs-quota

Change-Id: I8b8bc7189a9a59d1fab9dbc2013310988a2baf80 Signed-off-by: Amar Tumballi [email protected]

amarts avatar Jul 10 '22 17:07 amarts

This is good to handle issues like github.com/kadalu/kadalu#823. simple-quota with disperse need few more fixes like what should be the actual value of quota limit we should use at bricks.

Ideal fix is handling the quota set flag itself with value divided by fragments. Will send that fix with more testing and test cases. But for now, making it similar to deem-statfs would be good enough.

amarts avatar Jul 10 '22 18:07 amarts

@xhernandez when you check this PR, see if the below is a better option instead of changing _cbk()

diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index 9b5fe2a7fd..74576e725c 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -755,6 +755,19 @@ ec_setxattr(call_frame_t *frame, xlator_t *this, uintptr_t target,
         }
     }
 
+    ec_t *ec = fop->xl->private;
+    int64_t val = 0;
+    ret = dict_get_int64(fop->dict, SQUOTA_LIMIT_KEY, &val);
+    if (IS_SUCCESS(ret)) {
+      /* divide the total usage to priv->fragments */
+      int64_t new_value = val / ec->fragments;
+      ret = dict_set_int64(fop->dict, SQUOTA_LIMIT_KEY, new_value);
+      if (IS_ERROR(ret)) {
+       /* Add a trace log */
+        gf_msg(ec->xl->name, GF_LOG_DEBUG, ENOMEM, 0,
+               "Failed to update the simple-quota limit");
+      }
+    }
     error = 0;
 
 out:

amarts avatar Jul 14 '22 07:07 amarts

@amarts, this PR is not needed anymore now that #3672 is merged, right ?

xhernandez avatar Sep 22 '22 09:09 xhernandez

Yes. Let me close

amarts avatar Sep 22 '22 09:09 amarts

Thank you for your contributions. Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity. It will be closed in 2 weeks if no one responds with a comment here.

stale[bot] avatar May 20 '23 15:05 stale[bot]

Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.

stale[bot] avatar Jun 10 '23 03:06 stale[bot]