diff options
author | Kshitij Gupta <kshitij.gupta@mongodb.com> | 2022-12-16 20:18:48 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-16 21:23:07 +0000 |
commit | a2c7f46e2cc57b25d0d334376b901ed9f3988071 (patch) | |
tree | 2e4bee0b8c2dd2695d27176d7d7bfb012196f8a4 /src/mongo/db/cluster_role.cpp | |
parent | d2f91feb2e43823c165b1e25a5bfa7d53a81e997 (diff) | |
download | mongo-a2c7f46e2cc57b25d0d334376b901ed9f3988071.tar.gz |
SERVER-71959: Modify usages of ClusterRole::
Diffstat (limited to 'src/mongo/db/cluster_role.cpp')
-rw-r--r-- | src/mongo/db/cluster_role.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/cluster_role.cpp b/src/mongo/db/cluster_role.cpp index 108eff0b325..370207f7325 100644 --- a/src/mongo/db/cluster_role.cpp +++ b/src/mongo/db/cluster_role.cpp @@ -41,4 +41,17 @@ bool ClusterRole::operator==(const ClusterRole& other) const { return _value == other._value; } + +bool ClusterRole::isShardRole() { + return _value == ClusterRole::ShardServer || + (gFeatureFlagCatalogShard.isEnabledAndIgnoreFCV() && _value == ClusterRole::ConfigServer); +} + +bool ClusterRole::isExclusivelyShardRole() { + return _value == ClusterRole::ShardServer; +} + +bool ClusterRole::isExclusivelyConfigSvrRole() { + return _value == ClusterRole::ConfigServer && !gFeatureFlagCatalogShard.isEnabledAndIgnoreFCV(); +} } // namespace mongo |