-
Type: Improvement
-
Resolution: Declined
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.0.0, 7.0.0, 8.0.0-rc0
-
Component/s: None
-
Catalog and Routing
-
CAR Team 2024-04-29, CAR Team 2024-05-13
-
2
The goal of PM-2423 was to stop generating change stream events for write operations that modified orphan documents. These write operations that potentially modify orphan documents could be categorized in two different groups:
- The common case: write operations targeting more than one shard (i.e. write cmds attaching the ShardVersion::IGNORED()).
- Direct write operations against a shard.
For the first case, we decided to change our implementation to avoid writing on orphan documents at all. Thus, we won't generate a change stream event because the write doesn't happen at all. For the second case, after some discussion we agreed on always performing the write but marking it as fromMigrate: true if the document is not owned (ref).
Although targeted write operations (i.e. attacking only one shard, which implies that they are properly shard versioned) were not affected by the problem described above, after some discussions we decided to also perform the ownership check on each document. AFAIK we could totally skip that. If I recall correctly, all the write paths rely on the PreWriteFilter so it shouldn't be difficult to change a bit its logic.