summaryrefslogtreecommitdiff
path: root/src/mongo/db/namespace_string.cpp
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-01-24 13:45:05 -0500
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-01-24 13:45:05 -0500
commitfbf03e93dad1d2d081944c05436e777380873eb2 (patch)
tree8e2bd0d16febafcc10c0a201094967efb876c61b /src/mongo/db/namespace_string.cpp
parente59b03c06a034bac37435dbcdb2b631babe0f055 (diff)
downloadmongo-fbf03e93dad1d2d081944c05436e777380873eb2.tar.gz
SERVER-32251: Timestamp drop collection/database
Diffstat (limited to 'src/mongo/db/namespace_string.cpp')
-rw-r--r--src/mongo/db/namespace_string.cpp19
1 files changed, 19 insertions, 0 deletions
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();
}