diff options
-rw-r--r-- | libglusterfs/src/globals.h | 4 | ||||
-rw-r--r-- | tests/basic/distribute/bug-1265677-use-readdirp.t | 39 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-shared.c | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 6 |
4 files changed, 51 insertions, 1 deletions
diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h index 976302e73f9..6934aec5ed1 100644 --- a/libglusterfs/src/globals.h +++ b/libglusterfs/src/globals.h @@ -38,7 +38,7 @@ */ #define GD_OP_VERSION_MIN 1 /* MIN is the fresh start op-version, mostly should not change */ -#define GD_OP_VERSION_MAX GD_OP_VERSION_3_7_4 /* MAX VERSION is the maximum +#define GD_OP_VERSION_MAX GD_OP_VERSION_3_7_5 /* MAX VERSION is the maximum count in VME table, should keep changing with introduction of newer @@ -56,6 +56,8 @@ #define GD_OP_VERSION_3_7_4 30704 /* Op-version for GlusterFS 3.7.4 */ +#define GD_OP_VERSION_3_7_5 30705 /* Op-version for GlusterFS 3.7.5 */ + #define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_3_6_0 #include "xlator.h" diff --git a/tests/basic/distribute/bug-1265677-use-readdirp.t b/tests/basic/distribute/bug-1265677-use-readdirp.t new file mode 100644 index 00000000000..5b274d62667 --- /dev/null +++ b/tests/basic/distribute/bug-1265677-use-readdirp.t @@ -0,0 +1,39 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +# This test checks use-readdirp disable/enable for dht + +cleanup +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..1} +TEST $CLI volume heal $V0 disable +TEST $CLI volume set $V0 nfs.disable yes +TEST $CLI volume set $V0 dht.force-readdirp yes +TEST $CLI volume set $V0 performance.readdir-ahead off +TEST $CLI volume set $V0 performance.force-readdirp no +TEST $CLI volume start $V0 +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 --use-readdirp=no $M0; +TEST mkdir $M0/d +TEST touch $M0/d/{1..10} + +TEST $CLI volume profile $V0 start +#Clear all the fops till now +TEST $CLI volume profile $V0 info + +EXPECT "^10$" echo $(ls $M0/d | wc -l) +EXPECT_NOT "^0$" echo $($CLI volume profile $V0 info incremental | grep -w READDIRP | wc -l) +EXPECT "^10$" echo $(ls $M0/d | wc -l) +EXPECT "^0$" echo $($CLI volume profile $V0 info incremental | grep -w READDIR | wc -l) + +TEST $CLI volume set $V0 dht.force-readdirp no +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "0" mount_get_option_value $M0 $V0-dht use-readdirp + +EXPECT "^10$" echo $(ls $M0/d | wc -l) +EXPECT "^0$" echo $($CLI volume profile $V0 info incremental | grep -w READDIRP | wc -l) +EXPECT "^10$" echo $(ls $M0/d | wc -l) +EXPECT_NOT "^0$" echo $($CLI volume profile $V0 info incremental | grep -w READDIR | wc -l) + +cleanup diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index 342c2015b1a..2436eba2a0c 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -152,6 +152,7 @@ dht_priv_dump (xlator_t *this) gf_proc_dump_write("disk_unit", "%c", conf->disk_unit); gf_proc_dump_write("refresh_interval", "%d", conf->refresh_interval); gf_proc_dump_write("unhashed_sticky_bit", "%d", conf->unhashed_sticky_bit); + gf_proc_dump_write("use-readdirp", "%d", conf->use_readdirp); if (conf->du_stats && conf->subvolume_status) { for (i = 0; i < conf->subvolume_cnt; i++) { @@ -486,6 +487,8 @@ dht_reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("weighted-rebalance", conf->do_weighting, options, bool, out); + GF_OPTION_RECONF ("use-readdirp", conf->use_readdirp, options, + bool, out); ret = 0; out: return ret; diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 12bc04525e1..a643083df05 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -2054,6 +2054,12 @@ struct volopt_map_entry glusterd_volopt_map[] = { .op_version = GD_OP_VERSION_3_7_3, .type = NO_DOC, }, + { + .key = "dht.force-readdirp", + .voltype = "cluster/distribute", + .option = "use-readdirp", + .op_version = GD_OP_VERSION_3_7_5, + }, { .key = NULL } }; |