From e24fb2278bc0b0da88ec8c7b2d873c3e4a864d9d Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Sat, 14 Nov 2015 14:35:26 -0500 Subject: cluster/tier make cache mode default for tiered volumes The default mode for tiered volumes must be cache. The current test mode was for engineering and should ordinarily not be used by customers. This is a back port of 12581 > Change-Id: I20583f54a9269ce75daade645be18ab8575b0b9b > BUG: 1282076 > Signed-off-by: Dan Lambright > Reviewed-on: http://review.gluster.org/12581 > Tested-by: Gluster Build System > Reviewed-by: mohammed rafi kc Signed-off-by: Dan Lambright Change-Id: Ib2629d6d3e9b9374fddb5bc21cf068a1bcd96b9d BUG: 1283288 Reviewed-on: http://review.gluster.org/12647 Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- tests/basic/tier/file_with_spaces.t | 1 + tests/basic/tier/fops-during-migration-pause.t | 9 +++++---- tests/basic/tier/fops-during-migration.t | 1 + tests/basic/tier/legacy-many.t | 3 ++- tests/basic/tier/locked_file_migration.t | 1 + tests/basic/tier/tier_lookup_heal.t | 1 + xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 3 +++ xlators/mgmt/glusterd/src/glusterd-volume-set.c | 2 +- 8 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/basic/tier/file_with_spaces.t b/tests/basic/tier/file_with_spaces.t index 11bd1d2bf2a..7492804da1b 100755 --- a/tests/basic/tier/file_with_spaces.t +++ b/tests/basic/tier/file_with_spaces.t @@ -28,6 +28,7 @@ function create_dist_tier_vol () { TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ TEST $CLI volume set $V0 cluster.read-freq-threshold 50 TEST $CLI volume set $V0 cluster.write-freq-threshold 50 + TEST $CLI volume set $V0 cluster.tier-mode test } diff --git a/tests/basic/tier/fops-during-migration-pause.t b/tests/basic/tier/fops-during-migration-pause.t index 332e4bb1c03..f50d666ef27 100755 --- a/tests/basic/tier/fops-during-migration-pause.t +++ b/tests/basic/tier/fops-during-migration-pause.t @@ -2,11 +2,11 @@ . $(dirname $0)/../../include.rc . $(dirname $0)/../../volume.rc - +. $(dirname $0)/../../tier.rc NUM_BRICKS=3 -DEMOTE_FREQ=5 -PROMOTE_FREQ=5 +DEMOTE_FREQ=10 +PROMOTE_FREQ=10 TEST_STR="Testing write and truncate fops on tier migration" @@ -37,6 +37,7 @@ function create_dist_tier_vol () { TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ TEST $CLI volume set $V0 cluster.read-freq-threshold 0 TEST $CLI volume set $V0 cluster.write-freq-threshold 0 + TEST $CLI volume set $V0 cluster.tier-mode test } @@ -58,7 +59,7 @@ TEST mkdir $M0/dir1 # Create a large file (800MB), so that rebalance takes time # The file will be created on the hot tier - +sleep_until_mid_cycle $DEMOTE_FREQ dd if=/dev/zero of=$M0/dir1/FILE1 bs=256k count=5120 # Get the path of the file on the hot tier diff --git a/tests/basic/tier/fops-during-migration.t b/tests/basic/tier/fops-during-migration.t index aa868847738..b80511a400d 100755 --- a/tests/basic/tier/fops-during-migration.t +++ b/tests/basic/tier/fops-during-migration.t @@ -28,6 +28,7 @@ function create_dist_tier_vol () { TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ TEST $CLI volume set $V0 cluster.read-freq-threshold 0 TEST $CLI volume set $V0 cluster.write-freq-threshold 0 + TEST $CLI volume set $V0 cluster.tier-mode test } diff --git a/tests/basic/tier/legacy-many.t b/tests/basic/tier/legacy-many.t index 6e1147aec2d..0f32ff60a19 100644 --- a/tests/basic/tier/legacy-many.t +++ b/tests/basic/tier/legacy-many.t @@ -36,6 +36,7 @@ TEST $CLI volume set $V0 performance.quick-read off TEST $CLI volume set $V0 performance.io-cache off TEST $CLI volume set $V0 features.ctr-enabled on + TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; # Create a number of "legacy" files before attaching tier @@ -48,7 +49,7 @@ wait TEST $CLI volume attach-tier $V0 replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST TEST $CLI volume rebalance $V0 tier status - +TEST $CLI volume set $V0 cluster.tier-mode test TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ TEST $CLI volume set $V0 cluster.read-freq-threshold 0 diff --git a/tests/basic/tier/locked_file_migration.t b/tests/basic/tier/locked_file_migration.t index 7a03d1e3d36..f7a9d1f355d 100755 --- a/tests/basic/tier/locked_file_migration.t +++ b/tests/basic/tier/locked_file_migration.t @@ -31,6 +31,7 @@ function create_dist_tier_vol () { #We don't want promotes to happen in this test TEST $CLI volume set $V0 cluster.read-freq-threshold 10 TEST $CLI volume set $V0 cluster.write-freq-threshold 10 + TEST $CLI volume set $V0 cluster.tier-mode test } diff --git a/tests/basic/tier/tier_lookup_heal.t b/tests/basic/tier/tier_lookup_heal.t index 625b6b747ae..81bb0d67179 100755 --- a/tests/basic/tier/tier_lookup_heal.t +++ b/tests/basic/tier/tier_lookup_heal.t @@ -52,6 +52,7 @@ TEST $CLI volume set $V0 cluster.read-freq-threshold 0 TEST $CLI volume set $V0 cluster.write-freq-threshold 0 TEST $CLI volume set $V0 performance.quick-read off TEST $CLI volume set $V0 performance.io-cache off +TEST $CLI volume set $V0 cluster.tier-mode test #The lookup should heal the database. TEST ls file1 diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index a6dc94af06d..15738dfa18a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -2229,6 +2229,9 @@ glusterd_op_perform_attach_tier (dict_t *dict, if (!ret) ret = dict_set_str (volinfo->dict, "features.ctr-enabled", "on"); + if (!ret) + ret = dict_set_str (volinfo->dict, "cluster.tier-mode", "cache"); + return ret; } diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index e17a43dc835..02c6bc0c3b1 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -2023,7 +2023,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { { .key = "cluster.tier-mode", .voltype = "cluster/tier", .option = "tier-mode", - .value = "test", + .value = "cache", .op_version = GD_OP_VERSION_3_7_6, .flags = OPT_FLAG_CLIENT_OPT, .validate_fn = validate_tier, -- cgit