Problem description
As a consequence of PM-2423, direct write operations (performed from a client directly connected to a shard) on orphaned documents are allowed but must not generate events on change streams.
Multi-document transactions should have the same behavior, but at the moment this use case is bugged as events corresponding to individual statements are notified on change streams.
Agreed solution
The logic to skip notifications on changes stream leverages the existing fromMigrate flag of the oplog entry (that is, do not generate events when the flag is set). Unfortunately, the oplog entry corresponding to individual statements of a transaction (applyOps entries) don't have the fromMigrate flag and the change stream workflow is currently unable to skip related events.
Following a discussion with bernard.gorman@mongodb.com, we have agreed that the Sharding EMEA team will extend the applyOps entry with the fromMigrate flag where appropriate (see SERVER-65858), whereas the Query Execution team will modify the filtering as necessary across change streams to filter out these entries (see SERVER-65859).
|