From a07db0615af174ff60fd875b39998ef1ab51e243 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 23 Jan 2019 11:25:17 +0530 Subject: [PATCH] xlators default orders and volume default options Xlator order for client volfile changed to, ``` debug/io-stats performance/read-ahead performance/io-threads performance/nl-cache performance/quick-read performance/open-behind performance/io-cache performance/readdir-ahead performance/write-behind performance/md-cache features/utime features/shard cluster/distribute ``` This PR also disables Self heal by default.(Fixes: #1485) Signed-off-by: Aravinda VK --- e2e/glustershd_test.go | 12 +++++-- glusterd2/commands/volumes/grouped-options.go | 20 ++++++----- glusterd2/volgen/defaults.go | 34 ++++++++++++++++--- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/e2e/glustershd_test.go b/e2e/glustershd_test.go index 3d09b3bf6..99c0c91b3 100644 --- a/e2e/glustershd_test.go +++ b/e2e/glustershd_test.go @@ -208,6 +208,11 @@ func testGranularEntryHeal(t *testing.T, tc *testCluster) { _, err := client.VolumeCreate(createReq) r.Nil(err) + var optionReq api.VolOptionReq + optionReq.Options = map[string]string{"cluster/replicate.self-heal-daemon": "on"} + optionReq.AllowAdvanced = true + r.Nil(client.VolumeSet(volname, optionReq)) + r.Nil(client.VolumeStart(volname, false), "volume start failed") healInfo, err := client.SelfHealInfo(volname, "info-summary") @@ -218,7 +223,6 @@ func testGranularEntryHeal(t *testing.T, tc *testCluster) { } } - var optionReq api.VolOptionReq optionReq.Options = map[string]string{"cluster/replicate.granular-entry-heal": "enable"} optionReq.AllowAdvanced = true r.Nil(client.VolumeSet(volname, optionReq)) @@ -313,9 +317,13 @@ func testSplitBrainOperation(t *testing.T, tc *testCluster) { _, err := client.VolumeCreate(createReq) r.Nil(err) + var optionReq api.VolOptionReq + optionReq.Options = map[string]string{"cluster/replicate.self-heal-daemon": "on"} + optionReq.AllowAdvanced = true + r.Nil(client.VolumeSet(volname, optionReq)) + r.Nil(client.VolumeStart(volname, false), "volume start failed") - var optionReq api.VolOptionReq pidpath := path.Join(tc.gds[0].Rundir, "glustershd.pid") optionReq.Options = map[string]string{"cluster/replicate.self-heal-daemon": "off"} optionReq.AllowAdvanced = true diff --git a/glusterd2/commands/volumes/grouped-options.go b/glusterd2/commands/volumes/grouped-options.go index d966a23bd..a9ea1c860 100644 --- a/glusterd2/commands/volumes/grouped-options.go +++ b/glusterd2/commands/volumes/grouped-options.go @@ -9,14 +9,15 @@ var defaultGroupOptions = map[string]*api.OptionGroup{ "profile.default.replicate": { Name: "profile.default.replicate", Options: []api.VolumeOption{ - {Name: "cluster/replicate.self-heal-daemon", OnValue: "on"}, - {Name: "performance/md-cache", OnValue: "off"}, - {Name: "performance/open-behind", OnValue: "off"}, + {Name: "cluster/replicate.self-heal-daemon", OnValue: "off"}, {Name: "performance/quick-read", OnValue: "off"}, - {Name: "performance/io-cache", OnValue: "off"}, + {Name: "performance/io-cache", OnValue: "on"}, {Name: "performance/readdir-ahead", OnValue: "off"}, {Name: "performance/read-ahead", OnValue: "off"}, - {Name: "performance/write-behind", OnValue: "off"}, + {Name: "performance/write-behind", OnValue: "on"}, + {Name: "performance/open-behind", OnValue: "on"}, + {Name: "performance/md-cache", OnValue: "on"}, + {Name: "performance/nl-cache", OnValue: "on"}, }, Description: "Default volume options for Replicate or Distributed Replicate volumes", }, @@ -37,13 +38,14 @@ var defaultGroupOptions = map[string]*api.OptionGroup{ "profile.default.distribute": { Name: "profile.default.distribute", Options: []api.VolumeOption{ - {Name: "performance/md-cache", OnValue: "off"}, - {Name: "performance/open-behind", OnValue: "off"}, {Name: "performance/quick-read", OnValue: "off"}, - {Name: "performance/io-cache", OnValue: "off"}, + {Name: "performance/io-cache", OnValue: "on"}, {Name: "performance/readdir-ahead", OnValue: "off"}, {Name: "performance/read-ahead", OnValue: "off"}, - {Name: "performance/write-behind", OnValue: "off"}, + {Name: "performance/write-behind", OnValue: "on"}, + {Name: "performance/open-behind", OnValue: "on"}, + {Name: "performance/md-cache", OnValue: "on"}, + {Name: "performance/nl-cache", OnValue: "on"}, }, Description: "Default volume options for Distribute volumes", }, diff --git a/glusterd2/volgen/defaults.go b/glusterd2/volgen/defaults.go index 90fd163f3..165506d94 100644 --- a/glusterd2/volgen/defaults.go +++ b/glusterd2/volgen/defaults.go @@ -98,6 +98,25 @@ func init() { } // default client template + + // Quick-read should be a parent of open-behind (otherwise + // we'll suffer perf penalty for small file reads) + + // md-cache should be a descendant of write-behind (Otherwise + // we cannot leverage stats from brick in writev_cbk. Since + // writes invalidate kernel attributes, after a write, kernel + // will invariably ask glusterfs for stats. If stats are + // invalidated in md-cache by write-cbk - happens when + // md-cache is an ancestor of write-behind - stat fop will + // have to travel all the way to brick. However, if md-cache + // is a descendant of write-behind, stats in write-cbk from + // brick will be cached in md-cache) + + // If client-io-threads is enabled, read-ahead should be + // parent of client-io-threads (parallelism introduced by + // client-io-threads messes the sequential read detection + // logic in read-ahead). So, better to change the relative + // order of client-io-threads and read-ahead too tmpls[utils.ClientVolfile] = Template{ Name: utils.ClientVolfile, Level: VolfileLevelVolume, @@ -107,28 +126,33 @@ func init() { NameTmpl: "{{ volume.name }}", }, { - Type: "performance/io-threads", + Type: "performance/read-ahead", }, { - Type: "performance/md-cache", + Type: "performance/io-threads", + Disabled: true, }, { - Type: "performance/open-behind", + Type: "performance/nl-cache", }, { Type: "performance/quick-read", }, + { + Type: "performance/open-behind", + }, { Type: "performance/io-cache", }, { Type: "performance/readdir-ahead", }, + { - Type: "performance/read-ahead", + Type: "performance/write-behind", }, { - Type: "performance/write-behind", + Type: "performance/md-cache", }, { Type: "features/read-only",