From fbf03e93dad1d2d081944c05436e777380873eb2 Mon Sep 17 00:00:00 2001 From: Daniel Gottlieb Date: Wed, 24 Jan 2018 13:45:05 -0500 Subject: SERVER-32251: Timestamp drop collection/database --- src/mongo/db/namespace_string.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/mongo/db/namespace_string.cpp') diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index ba941475923..73e54524fe8 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -221,6 +221,25 @@ Status NamespaceString::checkLengthForRename( return Status::OK(); } +bool NamespaceString::isReplicated() const { + if (isLocal()) { + return false; + } + + // Of collections not in the `local` database, only `system` collections might not be + // replicated. + if (!isSystem()) { + return true; + } + + if (isSystemDotProfile()) { + return false; + } + + // E.g: `system.version` is replicated. + return true; +} + std::ostream& operator<<(std::ostream& stream, const NamespaceString& nss) { return stream << nss.toString(); } -- cgit v1.2.1