diff options
author | Kaushal M <kaushal@redhat.com> | 2013-04-01 17:55:30 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-04-26 01:45:06 -0700 |
commit | 915385553e46d65e0b91ce62066a5575b07ee44d (patch) | |
tree | 31544f7444ed6d4cf4169561ef0069d3dedfef7b /xlators/mgmt/glusterd/src/glusterd-volume-set.c | |
parent | 6419bd804b9cf43ad08fc54ef605c77b0e7895af (diff) |
glusterd: Introduce volume op-versions
Each volume is now associated with two op-versions,
* op_version - the op-version of the highest op-versioned feature enabled
* client_op_version - the op-version of the highest op-versioned feature
enabled which affects the clients only.
These two op-versions are generated dynamically and kept updated during
runtime. Glusterd now uses the respective volumes' client-op-version during
getspec requests.
To achieve the above a new field in the vme table is introduced,
client_option, this boolean field tells if the option is a client side
option.
Change-Id: I12c83b1dd29ab506026efd50d448cebbcee53c27
BUG: 907311
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4584
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 759 |
1 files changed, 416 insertions, 343 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index ec02680ab85..b04afdf9558 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -347,164 +347,197 @@ out: struct volopt_map_entry glusterd_volopt_map[] = { /* DHT xlator options */ - { .key = "cluster.lookup-unhashed", - .voltype = "cluster/distribute", - .op_version = 1 - }, - { .key = "cluster.min-free-disk", - .voltype = "cluster/distribute", - .op_version = 1 - }, - { .key = "cluster.min-free-inodes", - .voltype = "cluster/distribute", - .op_version = 1 - }, - { .key = "cluster.rebalance-stats", - .voltype = "cluster/distribute", - .op_version = 2 - }, - { .key = "cluster.subvols-per-directory", - .voltype = "cluster/distribute", - .option = "directory-layout-spread", - .op_version = 2, - .validate_fn = validate_subvols_per_directory - }, - { .key = "cluster.readdir-optimize", - .voltype = "cluster/distribute", - .op_version = 2 - }, - { .key = "cluster.nufa", - .voltype = "cluster/distribute", - .option = "!nufa", - .type = NO_DOC, - .op_version = 2 - }, - { .key = "cluster.rsync-hash-regex", - .voltype = "cluster/distribute", - .type = NO_DOC, - .op_version = 2 - }, - { .key = "cluster.extra-hash-regex", - .voltype = "cluster/distribute", - .type = NO_DOC, - .op_version = 2 - }, - { .key = "cluster.dht-xattr-name", - .voltype = "cluster/distribute", - .option = "xattr-name", - .type = NO_DOC, - .op_version = 2 + { .key = "cluster.lookup-unhashed", + .voltype = "cluster/distribute", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.min-free-disk", + .voltype = "cluster/distribute", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.min-free-inodes", + .voltype = "cluster/distribute", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.rebalance-stats", + .voltype = "cluster/distribute", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.subvols-per-directory", + .voltype = "cluster/distribute", + .option = "directory-layout-spread", + .op_version = 2, + .validate_fn = validate_subvols_per_directory, + .client_option = _gf_true + }, + { .key = "cluster.readdir-optimize", + .voltype = "cluster/distribute", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.nufa", + .voltype = "cluster/distribute", + .option = "!nufa", + .type = NO_DOC, + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.rsync-hash-regex", + .voltype = "cluster/distribute", + .type = NO_DOC, + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.extra-hash-regex", + .voltype = "cluster/distribute", + .type = NO_DOC, + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.dht-xattr-name", + .voltype = "cluster/distribute", + .option = "xattr-name", + .type = NO_DOC, + .op_version = 2, + .client_option = _gf_true }, /* AFR xlator options */ - { .key = "cluster.entry-change-log", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.read-subvolume", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.read-subvolume-index", - .voltype = "cluster/replicate", - .op_version = 2 - }, - { .key = "cluster.read-hash-mode", - .voltype = "cluster/replicate", - .op_version = 2 - }, - { .key = "cluster.background-self-heal-count", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.metadata-self-heal", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.data-self-heal", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.entry-self-heal", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.self-heal-daemon", - .voltype = "cluster/replicate", - .option = "!self-heal-daemon", - .op_version = 1 - }, - { .key = "cluster.heal-timeout", - .voltype = "cluster/replicate", - .option = "!heal-timeout", - .op_version = 2 - }, - { .key = "cluster.strict-readdir", - .voltype = "cluster/replicate", - .type = NO_DOC, - .op_version = 1 - }, - { .key = "cluster.self-heal-window-size", - .voltype = "cluster/replicate", - .option = "data-self-heal-window-size", - .op_version = 1 - }, - { .key = "cluster.data-change-log", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.metadata-change-log", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.data-self-heal-algorithm", - .voltype = "cluster/replicate", - .option = "data-self-heal-algorithm", - .op_version = 1 - }, - { .key = "cluster.eager-lock", - .voltype = "cluster/replicate", - .op_version = 1 - }, - { .key = "cluster.quorum-type", - .voltype = "cluster/replicate", - .option = "quorum-type", - .op_version = 1 - }, - { .key = "cluster.quorum-count", - .voltype = "cluster/replicate", - .option = "quorum-count", - .op_version = 1 - }, - { .key = "cluster.choose-local", - .voltype = "cluster/replicate", - .op_version = 2 - }, - { .key = "cluster.self-heal-readdir-size", - .voltype = "cluster/replicate", - .op_version = 2 - }, - { .key = "cluster.post-op-delay-secs", - .voltype = "cluster/replicate", - .type = NO_DOC, - .op_version = 2 - }, - { .key = "cluster.readdir-failover", - .voltype = "cluster/replicate", - .op_version = 2 + { .key = "cluster.entry-change-log", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.read-subvolume", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.read-subvolume-index", + .voltype = "cluster/replicate", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.read-hash-mode", + .voltype = "cluster/replicate", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.background-self-heal-count", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.metadata-self-heal", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.data-self-heal", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.entry-self-heal", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.self-heal-daemon", + .voltype = "cluster/replicate", + .option = "!self-heal-daemon", + .op_version = 1 + }, + { .key = "cluster.heal-timeout", + .voltype = "cluster/replicate", + .option = "!heal-timeout", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.strict-readdir", + .voltype = "cluster/replicate", + .type = NO_DOC, + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.self-heal-window-size", + .voltype = "cluster/replicate", + .option = "data-self-heal-window-size", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.data-change-log", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.metadata-change-log", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.data-self-heal-algorithm", + .voltype = "cluster/replicate", + .option = "data-self-heal-algorithm", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.eager-lock", + .voltype = "cluster/replicate", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.quorum-type", + .voltype = "cluster/replicate", + .option = "quorum-type", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.quorum-count", + .voltype = "cluster/replicate", + .option = "quorum-count", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "cluster.choose-local", + .voltype = "cluster/replicate", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.self-heal-readdir-size", + .voltype = "cluster/replicate", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.post-op-delay-secs", + .voltype = "cluster/replicate", + .type = NO_DOC, + .op_version = 2, + .client_option = _gf_true + }, + { .key = "cluster.readdir-failover", + .voltype = "cluster/replicate", + .op_version = 2, + .client_option = _gf_true }, /* Stripe xlator options */ - { .key = "cluster.stripe-block-size", - .voltype = "cluster/stripe", - .option = "block-size", - .op_version = 1, - .validate_fn = validate_stripe + { .key = "cluster.stripe-block-size", + .voltype = "cluster/stripe", + .option = "block-size", + .op_version = 1, + .validate_fn = validate_stripe, + .client_option = _gf_true }, - { .key = "cluster.stripe-coalesce", - .voltype = "cluster/stripe", - .option = "coalesce", - .op_version = 2 + { .key = "cluster.stripe-coalesce", + .voltype = "cluster/stripe", + .option = "coalesce", + .op_version = 2, + .client_option = _gf_true }, /* IO-stats xlator options */ @@ -530,48 +563,55 @@ struct volopt_map_entry glusterd_volopt_map[] = { .option = "!brick-log-level", .op_version = 1 }, - { .key = "diagnostics.client-log-level", - .voltype = "debug/io-stats", - .option = "!client-log-level", - .op_version = 1 + { .key = "diagnostics.client-log-level", + .voltype = "debug/io-stats", + .option = "!client-log-level", + .op_version = 1, + .client_option = _gf_true }, { .key = "diagnostics.brick-sys-log-level", .voltype = "debug/io-stats", .option = "!sys-log-level", .op_version = 1 }, - { .key = "diagnostics.client-sys-log-level", - .voltype = "debug/io-stats", - .option = "!sys-log-level", - .op_version = 1 + { .key = "diagnostics.client-sys-log-level", + .voltype = "debug/io-stats", + .option = "!sys-log-level", + .op_version = 1, + .client_option = _gf_true }, /* IO-cache xlator options */ - { .key = "performance.cache-max-file-size", - .voltype = "performance/io-cache", - .option = "max-file-size", - .op_version = 1, - .validate_fn = validate_cache_max_min_size - }, - { .key = "performance.cache-min-file-size", - .voltype = "performance/io-cache", - .option = "min-file-size", - .op_version = 1, - .validate_fn = validate_cache_max_min_size - }, - { .key = "performance.cache-refresh-timeout", - .voltype = "performance/io-cache", - .option = "cache-timeout", - .op_version = 1 - }, - { .key = "performance.cache-priority", - .voltype = "performance/io-cache", - .option = "priority", - .op_version = 1 - }, - { .key = "performance.cache-size", - .voltype = "performance/io-cache", - .op_version = 1 + { .key = "performance.cache-max-file-size", + .voltype = "performance/io-cache", + .option = "max-file-size", + .op_version = 1, + .validate_fn = validate_cache_max_min_size, + .client_option = _gf_true + }, + { .key = "performance.cache-min-file-size", + .voltype = "performance/io-cache", + .option = "min-file-size", + .op_version = 1, + .validate_fn = validate_cache_max_min_size, + .client_option = _gf_true + }, + { .key = "performance.cache-refresh-timeout", + .voltype = "performance/io-cache", + .option = "cache-timeout", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "performance.cache-priority", + .voltype = "performance/io-cache", + .option = "priority", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "performance.cache-size", + .voltype = "performance/io-cache", + .op_version = 1, + .client_option = _gf_true }, /* IO-threads xlator options */ @@ -606,79 +646,94 @@ struct volopt_map_entry glusterd_volopt_map[] = { }, /* Other perf xlators' options */ - { .key = "performance.cache-size", - .voltype = "performance/quick-read", - .op_version = 1 - }, - { .key = "performance.flush-behind", - .voltype = "performance/write-behind", - .option = "flush-behind", - .op_version = 1 - }, - { .key = "performance.write-behind-window-size", - .voltype = "performance/write-behind", - .option = "cache-size", - .op_version = 1 - }, - { .key = "performance.strict-o-direct", - .voltype = "performance/write-behind", - .option = "strict-O_DIRECT", - .op_version = 2 - }, - { .key = "performance.strict-write-ordering", - .voltype = "performance/write-behind", - .option = "strict-write-ordering", - .op_version = 2 - }, - { .key = "performance.lazy-open", - .voltype = "performance/open-behind", - .option = "lazy-open", - .op_version = 2 - }, - { .key = "performance.read-ahead-page-count", - .voltype = "performance/read-ahead", - .option = "page-count", - .op_version = 1 - }, - { .key = "performance.md-cache-timeout", - .voltype = "performance/md-cache", - .option = "md-cache-timeout", - .op_version = 2 + { .key = "performance.cache-size", + .voltype = "performance/quick-read", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "performance.flush-behind", + .voltype = "performance/write-behind", + .option = "flush-behind", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "performance.write-behind-window-size", + .voltype = "performance/write-behind", + .option = "cache-size", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "performance.strict-o-direct", + .voltype = "performance/write-behind", + .option = "strict-O_DIRECT", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "performance.strict-write-ordering", + .voltype = "performance/write-behind", + .option = "strict-write-ordering", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "performance.lazy-open", + .voltype = "performance/open-behind", + .option = "lazy-open", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "performance.read-ahead-page-count", + .voltype = "performance/read-ahead", + .option = "page-count", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "performance.md-cache-timeout", + .voltype = "performance/md-cache", + .option = "md-cache-timeout", + .op_version = 2, + .client_option = _gf_true }, /* Client xlator options */ - { .key = "network.frame-timeout", - .voltype = "protocol/client", - .op_version = 1 - }, - { .key = "network.ping-timeout", - .voltype = "protocol/client", - .op_version = 1 - }, - { .key = "network.tcp-window-size", - .voltype = "protocol/client", - .op_version = 1 - }, - { .key = "features.lock-heal", - .voltype = "protocol/client", - .option = "lk-heal", - .op_version = 1 - }, - { .key = "features.grace-timeout", - .voltype = "protocol/client", - .option = "grace-timeout", - .op_version = 1 - }, - { .key = "client.ssl", - .voltype = "protocol/client", - .option = "transport.socket.ssl-enabled", - .type = NO_DOC, - .op_version = 2 - }, - { .key = "network.remote-dio", - .voltype = "protocol/client", - .option = "filter-O_DIRECT", - .op_version = 1 + { .key = "network.frame-timeout", + .voltype = "protocol/client", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "network.ping-timeout", + .voltype = "protocol/client", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "network.tcp-window-size", + .voltype = "protocol/client", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "features.lock-heal", + .voltype = "protocol/client", + .option = "lk-heal", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "features.grace-timeout", + .voltype = "protocol/client", + .option = "grace-timeout", + .op_version = 1, + .client_option = _gf_true + }, + { .key = "client.ssl", + .voltype = "protocol/client", + .option = "transport.socket.ssl-enabled", + .type = NO_DOC, + .op_version = 2, + .client_option = _gf_true + }, + { .key = "network.remote-dio", + .voltype = "protocol/client", + .option = "filter-O_DIRECT", + .op_version = 1, + .client_option = _gf_true }, /* Server xlator options */ @@ -743,56 +798,67 @@ struct volopt_map_entry glusterd_volopt_map[] = { }, /* Performance xlators enable/disbable options */ - { .key = "performance.write-behind", - .voltype = "performance/write-behind", - .option = "!perf", - .value = "on", - .op_version = 1, - .description = "enable/disable write-behind translator in the volume." - }, - { .key = "performance.read-ahead", - .voltype = "performance/read-ahead", - .option = "!perf", - .value = "on", - .op_version = 1, - .description = "enable/disable read-ahead translator in the volume." - }, - { .key = "performance.io-cache", - .voltype = "performance/io-cache", - .option = "!perf", - .value = "on", - .op_version = 1, - .description = "enable/disable io-cache translator in the volume." - }, - { .key = "performance.quick-read", - .voltype = "performance/quick-read", - .option = "!perf", - .value = "on", - .op_version = 1, - .description = "enable/disable quick-read translator in the volume." - }, - { .key = "performance.open-behind", - .voltype = "performance/open-behind", - .option = "!perf", - .value = "on", - .op_version = 2, - .description = "enable/disable open-behind translator in the volume." - }, - { .key = "performance.stat-prefetch", - .voltype = "performance/md-cache", - .option = "!perf", - .value = "on", - .op_version = 1, - .description = "enable/disable meta-data caching translator in the " - "volume." - }, - { .key = "performance.client-io-threads", - .voltype = "performance/io-threads", - .option = "!perf", - .value = "off", - .op_version = 1, - .description = "enable/disable io-threads translator in the client " - "graph of volume." + { .key = "performance.write-behind", + .voltype = "performance/write-behind", + .option = "!perf", + .value = "on", + .op_version = 1, + .description = "enable/disable write-behind translator in the " + "volume.", + .client_option = _gf_true + }, + { .key = "performance.read-ahead", + .voltype = "performance/read-ahead", + .option = "!perf", + .value = "on", + .op_version = 1, + .description = "enable/disable read-ahead translator in the " + "volume.", + .client_option = _gf_true + }, + { .key = "performance.io-cache", + .voltype = "performance/io-cache", + .option = "!perf", + .value = "on", + .op_version = 1, + .description = "enable/disable io-cache translator in the volume.", + .client_option = _gf_true + }, + { .key = "performance.quick-read", + .voltype = "performance/quick-read", + .option = "!perf", + .value = "on", + .op_version = 1, + .description = "enable/disable quick-read translator in the " + "volume.", + .client_option = _gf_true + }, + { .key = "performance.open-behind", + .voltype = "performance/open-behind", + .option = "!perf", + .value = "on", + .op_version = 2, + .description = "enable/disable open-behind translator in the " + "volume.", + .client_option = _gf_true + }, + { .key = "performance.stat-prefetch", + .voltype = "performance/md-cache", + .option = "!perf", + .value = "on", + .op_version = 1, + .description = "enable/disable meta-data caching translator in the " + "volume.", + .client_option = _gf_true + }, + { .key = "performance.client-io-threads", + .voltype = "performance/io-threads", + .option = "!perf", + .value = "off", + .op_version = 1, + .description = "enable/disable io-threads translator in the client " + "graph of volume.", + .client_option = _gf_true }, { .key = "performance.nfs.write-behind", .voltype = "performance/write-behind", @@ -836,33 +902,37 @@ struct volopt_map_entry glusterd_volopt_map[] = { .type = NO_DOC, .op_version = 1 }, - { .key = "performance.force-readdirp", - .voltype = "performance/md-cache", - .option = "force-readdirp", - .op_version = 2 + { .key = "performance.force-readdirp", + .voltype = "performance/md-cache", + .option = "force-readdirp", + .op_version = 2, + .client_option = _gf_true }, /* Quota xlator options */ - { .key = VKEY_FEATURES_LIMIT_USAGE, - .voltype = "features/quota", - .option = "limit-set", - .type = NO_DOC, - .op_version = 1 - }, - { .key = "features.quota-timeout", - .voltype = "features/quota", - .option = "timeout", - .value = "0", - .op_version = 1, - .validate_fn = validate_quota - }, - { .key = "features.quota-deem-statfs", - .voltype = "features/quota", - .option = "deem-statfs", - .value = "off", - .type = DOC, - .op_version = 2, - .validate_fn = validate_quota + { .key = VKEY_FEATURES_LIMIT_USAGE, + .voltype = "features/quota", + .option = "limit-set", + .type = NO_DOC, + .op_version = 1, + .client_option = _gf_true + }, + { .key = "features.quota-timeout", + .voltype = "features/quota", + .option = "timeout", + .value = "0", + .op_version = 1, + .validate_fn = validate_quota, + .client_option = _gf_true + }, + { .key = "features.quota-deem-statfs", + .voltype = "features/quota", + .option = "deem-statfs", + .value = "off", + .type = DOC, + .op_version = 2, + .validate_fn = validate_quota, + .client_option = _gf_true }, /* Marker xlator options */ @@ -1083,17 +1153,19 @@ struct volopt_map_entry glusterd_volopt_map[] = { }, /* Other options which don't fit any place above */ - { .key = "features.read-only", - .voltype = "features/read-only", - .option = "!read-only", - .value = "off", - .op_version = 2 - }, - { .key = "features.worm", - .voltype = "features/worm", - .option = "!worm", - .value = "off", - .op_version = 2 + { .key = "features.read-only", + .voltype = "features/read-only", + .option = "!read-only", + .value = "off", + .op_version = 2, + .client_option = _gf_true + }, + { .key = "features.worm", + .voltype = "features/worm", + .option = "!worm", + .value = "off", + .op_version = 2, + .client_option = _gf_true }, { .key = "storage.linux-aio", .voltype = "storage/posix", @@ -1113,10 +1185,11 @@ struct volopt_map_entry glusterd_volopt_map[] = { .voltype = "storage/posix", .op_version = 2 }, - { .key = "config.memory-accounting", - .voltype = "configuration", - .option = "!config", - .op_version = 2 + { .key = "config.memory-accounting", + .voltype = "configuration", + .option = "!config", + .op_version = 2, + .client_option = _gf_true }, { .key = "config.transport", .voltype = "configuration", |