Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

xlators default orders and volume default options #1490

Merged
merged 1 commit into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions e2e/glustershd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions glusterd2/commands/volumes/grouped-options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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",
},
Expand Down
34 changes: 29 additions & 5 deletions glusterd2/volgen/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down