summaryrefslogtreecommitdiff
path: root/src/mongo/db/namespace_string.cpp
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2021-04-29 12:41:24 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-29 17:04:20 +0000
commit9caac5e1856eea2c9152a09f966c80b2a5b1c1c0 (patch)
treeb7a0ea286d36efd7dec7d65fc5cd102bcc3f9462 /src/mongo/db/namespace_string.cpp
parentbbf49c8019ec253013ad2df96951ab3201872d6a (diff)
downloadmongo-9caac5e1856eea2c9152a09f966c80b2a5b1c1c0.tar.gz
SERVER-56292 Ensure time-series collections properly handle stepdown and stepup
Diffstat (limited to 'src/mongo/db/namespace_string.cpp')
-rw-r--r--src/mongo/db/namespace_string.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp
index 6f1b7c63622..9c6d9ae93bd 100644
--- a/src/mongo/db/namespace_string.cpp
+++ b/src/mongo/db/namespace_string.cpp
@@ -328,6 +328,11 @@ NamespaceString NamespaceString::makeTimeseriesBucketsNamespace() const {
return {db(), kTimeseriesBucketsCollectionPrefix.toString() + coll()};
}
+NamespaceString NamespaceString::getTimeseriesViewNamespace() const {
+ invariant(isTimeseriesBucketsCollection());
+ return {db(), coll().substr(kTimeseriesBucketsCollectionPrefix.size())};
+}
+
bool NamespaceString::isReplicated() const {
if (isLocal()) {
return false;