diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2017-08-15 19:41:46 -0400 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2017-09-13 17:40:18 -0400 |
commit | c1c269079f892c2b554491997eb6d9114d890838 (patch) | |
tree | 37c721d20dcc6d65fbb7e77f8271867541006622 /src/mongo/db/op_observer.h | |
parent | 5a44e562c9cb85ba253a27e513d061802ef77b57 (diff) | |
download | mongo-c1c269079f892c2b554491997eb6d9114d890838.tar.gz |
SERVER-29961 Close change notification cursors when a chunk migrates to a new shard
Diffstat (limited to 'src/mongo/db/op_observer.h')
-rw-r--r-- | src/mongo/db/op_observer.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index 067f49cd9d0..3ff05ff561d 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -121,7 +121,25 @@ public: CollectionShardingState::DeleteState deleteState, bool fromMigrate, const boost::optional<BSONObj>& deletedDoc) = 0; - virtual void onOpMessage(OperationContext* opCtx, const BSONObj& msgObj) = 0; + /** + * Logs a no-op with "msgObj" in the o field into oplog. + * + * This function should only be used internally. "nss", "uuid" and the o2 field should never be + * exposed to users (for instance through the appendOplogNote command). + */ + virtual void onInternalOpMessage(OperationContext* opCtx, + const NamespaceString& nss, + const boost::optional<UUID> uuid, + const BSONObj& msgObj, + const boost::optional<BSONObj> o2MsgObj) = 0; + + /** + * Logs a no-op with "msgObj" in the o field into oplog. + */ + void onOpMessage(OperationContext* opCtx, const BSONObj& msgObj) { + onInternalOpMessage(opCtx, {}, boost::none, msgObj, boost::none); + } + virtual void onCreateCollection(OperationContext* opCtx, Collection* coll, const NamespaceString& collectionName, |