summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/coll_mod.h
diff options
context:
space:
mode:
authorMaria van Keulen <maria@mongodb.com>2017-05-30 13:43:26 -0400
committerMaria van Keulen <maria@mongodb.com>2017-07-25 17:29:17 -0400
commitb2ef59c4fa30c2e242840cc1aa55de3c8cdfa887 (patch)
tree8d8c2b64322b823e856b86f023fa4b83ea0ebf39 /src/mongo/db/catalog/coll_mod.h
parentba178d6455bd8490bfb90c434c9b1ef66b37c643 (diff)
downloadmongo-b2ef59c4fa30c2e242840cc1aa55de3c8cdfa887.tar.gz
SERVER-29370 Update UUIDs when featureCompatibilityVersion is changed
This patch ensures collections have UUIDs when featureCompatibilityVersion is 3.6 and collections do not have UUIDs when featureCompatibilityVersion is 3.4 (or below).
Diffstat (limited to 'src/mongo/db/catalog/coll_mod.h')
-rw-r--r--src/mongo/db/catalog/coll_mod.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/coll_mod.h b/src/mongo/db/catalog/coll_mod.h
index 456103f4c2f..8a6eda14f46 100644
--- a/src/mongo/db/catalog/coll_mod.h
+++ b/src/mongo/db/catalog/coll_mod.h
@@ -28,6 +28,7 @@
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
+#include "mongo/db/catalog/collection_options.h"
namespace mongo {
class BSONObj;
@@ -36,6 +37,8 @@ class Collection;
class NamespaceString;
class OperationContext;
+void updateUUIDSchemaVersion(OperationContext* opCtx, bool upgrade);
+
/**
* Performs the collection modification described in "cmdObj" on the collection "ns".
*/
@@ -43,4 +46,14 @@ Status collMod(OperationContext* opCtx,
const NamespaceString& ns,
const BSONObj& cmdObj,
BSONObjBuilder* result);
+
+/*
+ * Adds uuid to the collection "ns" if uuid exists and removes any existing UUID from
+ * the collection "ns" if uuid is boost::none. This is called in circumstances where
+ * we may be upgrading or downgrading and we need to update the UUID.
+ */
+Status collModForUUIDUpgrade(OperationContext* opCtx,
+ const NamespaceString& ns,
+ const BSONObj& cmdObj,
+ OptionalCollectionUUID uuid);
} // namespace mongo