21ab4e
From 0a206c61eae002c1d7153732849abb227f2472de Mon Sep 17 00:00:00 2001
21ab4e
From: Poornima G <pgurusid@redhat.com>
21ab4e
Date: Fri, 17 Feb 2017 14:05:25 +0530
21ab4e
Subject: [PATCH 361/361] glusterd, readdir-ahead: Fix backward incompatibility
21ab4e
21ab4e
Issue:
21ab4e
Any opion is spcified in two places: In the options[] of xlator
21ab4e
itself and glusterd-volume-set.c. The default value of this option
21ab4e
can be specified in both the places. If its specified only in xlator
21ab4e
then the volfile generated will not have the option and default value,
21ab4e
it will be assigned during graph initialization.
21ab4e
With patch [1] the option rda-request-size was changed from INT to SIZET
21ab4e
type, and default was changed from 131072 to 128KB, but was specified
21ab4e
only in the readdir-ahead.c. Thus with this patch alone the volfile
21ab4e
entry for readdir-ahead looks like:
21ab4e
volume patchy-readdir-ahead
21ab4e
    type performance/readdir-ahead
21ab4e
    subvolumes patchy-read-ahead
21ab4e
end-volume
21ab4e
21ab4e
With patch [2], the default of option rda-request-size was specified
21ab4e
in glusterd-volume-set.c as well(as it was necessary fr parallel readdir).
21ab4e
With this patch the readdir entry in the volfile will look like:
21ab4e
volume patchy-readdir-ahead
21ab4e
    type performance/readdir-ahead
21ab4e
    option rda-cache-limit 10MB
21ab4e
    option rda-request-size 128KB
21ab4e
    option parallel-readdir off
21ab4e
    subvolumes patchy-read-ahead
21ab4e
end-volume
21ab4e
21ab4e
Now consider the server has both these patches and client doesn't.
21ab4e
Server will generate a volfile with entry:
21ab4e
21ab4e
The old clients which thought the option rda-request-size is of type
21ab4e
INT will now recieve the value 128KB which it willn't understand,
21ab4e
and hence fail the mount.
21ab4e
21ab4e
The issue is seen only with the combination of [1] and [2].
21ab4e
21ab4e
Solution:
21ab4e
Instead of specifying 128KB as default in glusterd we specify 131072
21ab4e
so that the old clients will interpret as INT and new ones as 128KB
21ab4e
21ab4e
Credits: Raghavendra G
21ab4e
21ab4e
mainline:
21ab4e
> BUG: 1423410
21ab4e
> Reviewed-on: https://review.gluster.org/16657
21ab4e
> Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
21ab4e
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
21ab4e
> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
(cherry picked from commit 3cda64115596f0501bb58209f819655bced22c18)
21ab4e
21ab4e
BUG: 1427096
21ab4e
Change-Id: I0c269a5890957fd8a38e9a05bdec088645a6688a
21ab4e
Signed-off-by: Poornima G <pgurusid@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/101421
21ab4e
Tested-by: Milind Changire <mchangir@redhat.com>
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 xlators/mgmt/glusterd/src/glusterd-volume-set.c       | 2 +-
21ab4e
 xlators/performance/readdir-ahead/src/readdir-ahead.c | 2 +-
21ab4e
 2 files changed, 2 insertions(+), 2 deletions(-)
21ab4e
21ab4e
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
21ab4e
index 78b2ead..e619401 100644
21ab4e
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
21ab4e
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
21ab4e
@@ -3032,7 +3032,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
21ab4e
 	{ .key         = "performance.rda-request-size",
21ab4e
 	  .voltype     = "performance/readdir-ahead",
21ab4e
           .option      = "rda-request-size",
21ab4e
-          .value       = "128KB",
21ab4e
+          .value       = "131072",
21ab4e
           .flags       = OPT_FLAG_CLIENT_OPT,
21ab4e
           .type        = DOC,
21ab4e
           .op_version  = GD_OP_VERSION_3_9_1,
21ab4e
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c
21ab4e
index 17569c2..13e3a43 100644
21ab4e
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.c
21ab4e
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c
21ab4e
@@ -732,7 +732,7 @@ struct volume_options options[] = {
21ab4e
 	  .type = GF_OPTION_TYPE_SIZET,
21ab4e
 	  .min = 4096,
21ab4e
 	  .max = 131072,
21ab4e
-	  .default_value = "128KB",
21ab4e
+	  .default_value = "131072",
21ab4e
 	  .description = "size of buffer in readdirp calls initiated by "
21ab4e
                          "readdir-ahead ",
21ab4e
 	},
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e