summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/global_user_write_block_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/global_user_write_block_state.h')
-rw-r--r--src/mongo/db/s/global_user_write_block_state.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mongo/db/s/global_user_write_block_state.h b/src/mongo/db/s/global_user_write_block_state.h
index 8325b717b15..f354f14a186 100644
--- a/src/mongo/db/s/global_user_write_block_state.h
+++ b/src/mongo/db/s/global_user_write_block_state.h
@@ -49,12 +49,25 @@ public:
/**
* Checks that user writes are allowed on the specified namespace. Callers must hold the
- * GlobalLock in any mode.
+ * GlobalLock in any mode. Throws OperationFailed if user writes are disallowed.
*/
void checkUserWritesAllowed(OperationContext* opCtx, const NamespaceString& nss) const;
+ /**
+ * Methods to enable/disable blocking new sharded DDL operations.
+ */
+ void enableUserShardedDDLBlocking(OperationContext* opCtx);
+ void disableUserShardedDDLBlocking(OperationContext* opCtx);
+
+ /**
+ * Checks that new sharded DDL operations are allowed to start. Throws OperationFailed if
+ * starting new sharded DDL operations is disallowed.
+ */
+ void checkShardedDDLAllowedToStart(OperationContext* opCtx, const NamespaceString& nss) const;
+
private:
bool _globalUserWritesBlocked{false};
+ AtomicWord<bool> _userShardedDDLBlocked{false};
};
} // namespace mongo