summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-10-04 18:27:48 -0400
committerDavid Storch <david.storch@10gen.com>2018-10-23 17:18:11 -0400
commit2cdc2a96e1c8779658fe0eab459dcc38cf01c54d (patch)
tree875f55acaaba283f02895938ee4b6c764eac349a /src/mongo/db/op_observer.h
parente7bed9bdcb376d5a06dce6228047309e8481f9cf (diff)
downloadmongo-2cdc2a96e1c8779658fe0eab459dcc38cf01c54d.tar.gz
SERVER-37443 Make catalog objects survive collection rename.
This change only applies to collection renames within the same database. Rename across databases requires copying the data, and the resulting collection will have a new UUID.
Diffstat (limited to 'src/mongo/db/op_observer.h')
-rw-r--r--src/mongo/db/op_observer.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h
index fac5943f45d..52abe0618b5 100644
--- a/src/mongo/db/op_observer.h
+++ b/src/mongo/db/op_observer.h
@@ -80,6 +80,15 @@ struct TTLCollModInfo {
*/
class OpObserver {
public:
+ enum class CollectionDropType {
+ // The collection is being dropped immediately, in one step.
+ kOnePhase,
+
+ // The collection is being dropped in two phases, by renaming to a drop pending collection
+ // which is registered to be reaped later.
+ kTwoPhase,
+ };
+
virtual ~OpObserver() = default;
virtual void onCreateIndex(OperationContext* opCtx,
const NamespaceString& nss,
@@ -178,10 +187,13 @@ public:
* This function logs an oplog entry when a 'drop' command on a collection is executed.
* Returns the optime of the oplog entry successfully written to the oplog.
* Returns a null optime if an oplog entry was not written for this operation.
+ *
+ * 'dropType' describes whether the collection drop is one-phase or two-phase.
*/
virtual repl::OpTime onDropCollection(OperationContext* opCtx,
const NamespaceString& collectionName,
- OptionalCollectionUUID uuid) = 0;
+ OptionalCollectionUUID uuid,
+ CollectionDropType dropType) = 0;
/**
* This function logs an oplog entry when an index is dropped. The namespace of the index,