diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-01-24 13:45:05 -0500 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-01-24 13:45:05 -0500 |
commit | fbf03e93dad1d2d081944c05436e777380873eb2 (patch) | |
tree | 8e2bd0d16febafcc10c0a201094967efb876c61b /src/mongo/db/namespace_string.cpp | |
parent | e59b03c06a034bac37435dbcdb2b631babe0f055 (diff) | |
download | mongo-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.cpp | 19 |
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(); } |