mirror of
https://github.com/gluster/glusterd2.git
synced 2026-02-05 21:45:43 +01:00
Category prefix is optional when setting Volume options. For example to set replicate.eager-lock, we can pass `replicate.eager-lock` or `cluster/replicate.eager-lock`. With this PR, always stored with category prefix. Also fixed the issue of loosing template variables when xlator default options and volinfo.Options are loaded(Fixes: #1397) Signed-off-by: Aravinda VK <avishwan@redhat.com>
31 lines
807 B
Go
31 lines
807 B
Go
package glustershd
|
|
|
|
import (
|
|
"github.com/gluster/glusterd2/glusterd2/volume"
|
|
)
|
|
|
|
const (
|
|
selfHealKey = "self-heal-daemon"
|
|
shdKey = "cluster/replicate." + selfHealKey
|
|
granularEntryHealKey = "granular-entry-heal"
|
|
)
|
|
|
|
// isVolReplicate returns true if volume is of type replicate, disperse, distreplicate or distdisperse
|
|
// otherwise it returns false
|
|
func isVolReplicate(vType volume.VolType) bool {
|
|
if vType == volume.Replicate || vType == volume.Disperse || vType == volume.DistReplicate || vType == volume.DistDisperse {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// isHealEnabled returns true if heal is enabled for the volume otherwise returns false.
|
|
func isHealEnabled(v *volume.Volinfo) bool {
|
|
value, ok := v.Options[shdKey]
|
|
if ok && value == "on" {
|
|
return true
|
|
}
|
|
return false
|
|
}
|