-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
0
Problem
The server omits shard key fields in a change event's document key field if the document lacks that field. That is: for a collection sharded on (sk: 1, _id: 1), if a document is missing the sk field, its documentKey in the change stream is (_id: 1 ) rather than (sk: null, _id: 1). However, the server treats missing shard key fields as null internally.
Solution
Change event documentKeys should also include null shard key fields.
Impact
In WRITING-31304, the current logic will force mongosync to manually check for missing / null shard key fields based on the collection's shard key pattern. This is necessary to ensure that mongosync does queries on the full document key (instead of just the _id field). This is critical for mongosync correctness.
Fixing this logic will allow mongosync to eventually stop doing this workaround.