summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/database_sharding_state.h
diff options
context:
space:
mode:
authorTommaso Tocci <tommaso.tocci@mongodb.com>2021-02-15 13:17:06 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-24 21:09:28 +0000
commit5f06484704079c88b81d7ec6ba9a223c651b1a2e (patch)
tree20979701f24ac994f4257647484a9ff8d6c5ad6e /src/mongo/db/s/database_sharding_state.h
parent0949e167fe3b54f06117c9797e760d4cd2cb6b8b (diff)
downloadmongo-5f06484704079c88b81d7ec6ba9a223c651b1a2e.tar.gz
SERVER-53905 Implement PrimaryOnlyService for DDL coordinators
Diffstat (limited to 'src/mongo/db/s/database_sharding_state.h')
-rw-r--r--src/mongo/db/s/database_sharding_state.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/s/database_sharding_state.h b/src/mongo/db/s/database_sharding_state.h
index 836570e67ef..b1624bbd9b8 100644
--- a/src/mongo/db/s/database_sharding_state.h
+++ b/src/mongo/db/s/database_sharding_state.h
@@ -73,6 +73,16 @@ public:
OperationContext* opCtx, const StringData dbName);
/**
+ * Checks if this shard is the primary shard for the given DB.
+ *
+ * Throws an IllegalOperation exception otherwise.
+ *
+ * Assumes the operation context has a DB version attached to it for the given @dbName.
+ */
+ static void checkIsPrimaryShardForDb(OperationContext* opCtx, StringData dbName);
+
+
+ /**
* Methods to control the databases's critical section. Must be called with the database X lock
* held.
*/