glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

glusterd: Enable cluster.use-anonymous-inode for op-version >= 9

Open pranithk opened this issue 3 years ago • 6 comments

Problem: On upgrade even though the op-version of gluster is less than 9 cluster.use-anonymous-inode option is enabled leading to unnecessary processing by self-heal-daemon

Fix: Enable this option based on op-version

fixes: #2462 Change-Id: Ib27ca27c0661fc07efd1dea66285796a3b8a2bc9 Signed-off-by: Pranith Kumar K [email protected]

pranithk avatar Jun 20 '21 10:06 pranithk

I am not sure what is the best fix for this issue. Default values seem to be applied on volfiles without taking op-version into consideration. If I apply this PR, that problem is fixed, but gluster volume get for this command will show NO when in fact cluster.use-anonymous-inode is enabled. I am not sure what would be the correct fix in this case.

When the op-version is >= 9.0 I would like this option to be enabled by default.

pranithk avatar Jun 20 '21 10:06 pranithk

CLANG-FORMAT FAILURE: Before merging the patch, this diff needs to be considered for passing clang-format

index 952b0ae55..5e2631946 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3935,8 +3935,7 @@ set_volfile_id_and_use_anonymous_inode_option(volgen_graph_t *graph,
             goto out;
 
         if (!dict_get_sizen(volinfo->dict, "cluster.use-anonymous-inode")) {
-            ret = xlator_set_fixed_option(xlator, "use-anonymous-inode",
-                                          "yes");
+            ret = xlator_set_fixed_option(xlator, "use-anonymous-inode", "yes");
             if (ret)
                 goto out;
         }
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index f950a3304..81d32708f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -1057,7 +1057,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
     {.key = "cluster.ensure-durability",
      .voltype = "cluster/replicate",
      .op_version = 3,
-    .type = NO_DOC,
+     .type = NO_DOC,
      .flags = VOLOPT_FLAG_CLIENT_OPT},
     {.key = "cluster.consistent-metadata",
      .voltype = "cluster/replicate",
@@ -3106,7 +3106,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
 
     {.key = "rebalance.ensure-durability",
      .voltype = "cluster/distribute",
-    .type = NO_DOC,
+     .type = NO_DOC,
      .op_version = GD_OP_VERSION_10_0,
      .flags = VOLOPT_FLAG_CLIENT_OPT},
     {.key = NULL}};

gluster-ant avatar Jun 20 '21 10:06 gluster-ant

If the user cannot bump up the op-version to 9 (if they cannot upgrade old clients etc), will explicitly setting use-anonymous-inode to false work without the need for this fix (except for the afr.c change maybe)?

I saw that the op-version bump-up was allowed even when there were older clients. So this is one more problem. After all the servers are upgraded the use-anonymous-inode will be in affect, which will expose the special directory to the older clients. Even if we disable this option immediately after the server upgrades, there could be chances that this special folder gets created even before that.

karthik-us avatar Jun 22 '21 11:06 karthik-us

I am not sure what is the best fix for this issue. Default values seem to be applied on volfiles without taking op-version into consideration. If I apply this PR, that problem is fixed, but gluster volume get for this command will show NO when in fact cluster.use-anonymous-inode is enabled. I am not sure what would be the correct fix in this case.

When the op-version is >= 9.0 I would like this option to be enabled by default.

I think by default option should be disable because the client needs to update also to use the features. There is no benefit to enable the option if client is not upgraded. AFAIK we do support two previous version of client from server version so we should enable this option only at the time of generate a new client volfile during call of client_graph_builder by glusterd-volgen.c .

mohit84 avatar Jun 23 '21 04:06 mohit84

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 Jan 20 '22 17:01 stale[bot]

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 Sep 20 '22 19:09 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 Oct 16 '22 03:10 stale[bot]