mirror of
https://github.com/gluster/glusterd2.git
synced 2026-02-05 21:45:43 +01:00
- Group profile for transactional DB workload added - Fixed the option names used in other group profiles - Fixed the validation issues related to setting the options glusterfs PR to support enable/disable of xlators https://review.gluster.org/21813 Fixes: #1250 Signed-off-by: Aravinda VK <avishwan@redhat.com>
33 lines
742 B
Go
33 lines
742 B
Go
package dht
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/gluster/glusterd2/glusterd2/volume"
|
|
"github.com/gluster/glusterd2/glusterd2/xlator"
|
|
)
|
|
|
|
var names = [...]string{"distribute", "dht"}
|
|
|
|
func validateOptions(v *volume.Volinfo, key, value string) error {
|
|
if strings.Contains(key, "readdirplus-for-dir") {
|
|
if value == "on" {
|
|
if v, ok := v.Options["features/upcall.cache-invalidation"]; ok && v == "on" {
|
|
return nil
|
|
}
|
|
if v, ok := v.Options["upcall.cache-invalidation"]; ok && v == "on" {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("enable \"features/upcall.cache-invalidation\" before enabling %s", key)
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
for _, name := range names {
|
|
xlator.RegisterValidationFunc(name, validateOptions)
|
|
}
|
|
}
|