diff options
author | Arun Banala <arun.banala@mongodb.com> | 2022-04-29 12:56:44 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-23 07:52:57 +0000 |
commit | 9d559b3ad8942ade301b41284dee9e6b8c8f098c (patch) | |
tree | 2942842824443d062be972c637219e02136ac93c /src/mongo/db/pipeline/change_stream_helpers_legacy.h | |
parent | fb4724113317c2279e340047b3a1cd8d6c72fb36 (diff) | |
download | mongo-9d559b3ad8942ade301b41284dee9e6b8c8f098c.tar.gz |
SERVER-65909 Make oplog and change stream formats of {op: "n"} events consistent
Diffstat (limited to 'src/mongo/db/pipeline/change_stream_helpers_legacy.h')
-rw-r--r-- | src/mongo/db/pipeline/change_stream_helpers_legacy.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/change_stream_helpers_legacy.h b/src/mongo/db/pipeline/change_stream_helpers_legacy.h index fff3b770134..e2e17843b49 100644 --- a/src/mongo/db/pipeline/change_stream_helpers_legacy.h +++ b/src/mongo/db/pipeline/change_stream_helpers_legacy.h @@ -66,4 +66,19 @@ static const std::set<StringData> kClassicOperationTypes = DocumentSourceChangeStream::kReshardDoneCatchUpOpType, DocumentSourceChangeStream::kNewShardDetectedOpType}; +/** + * Adds filtering for legacy-format {op: 'n'} oplog messages, which used the "o2.type" field to + * indicate the message type. + */ +void populateInternalOperationFilter(const boost::intrusive_ptr<ExpressionContext>& expCtx, + BSONArrayBuilder* filter); + +/** + * Converts legacy-format oplog o2 fields of type {type: <op name>, ...} to + * {..., <op name>: <namespace>}. Does nothing if the 'type' field is not present inside 'o2'. + */ +Document convertFromLegacyOplogFormat(const Document& legacyO2Entry, const NamespaceString& nss); + +StringData getNewShardDetectedOpName(const boost::intrusive_ptr<ExpressionContext>& expCtx); + } // namespace mongo::change_stream_legacy |