The namespace translation for legacy timeseries collection in the findAndModify command is done in two places:
- For normal findAndModify commands, we change the nss variable here
- For explain findAndModify commands, we replace the nss inside the original command object here
In the first case we perform the translation whenever we are targeting a legacy timeseries collections:
isTrackedTimeseries && !cm.isNewTimeseriesWithoutView()
On the other hand, for the second case we are not performing the translation in case the operation is a rawData operation received over the main timeseries namespace:
isTimeseriesLogicalRequest && !cri.getChunkManager().isNewTimeseriesWithoutView()
The second case is wrong, and in fact we should perform both translation using the first condition.
The result is that we are sending a command on the main timeseries nss (e.g. `myColl`) along with a ShardVersion associated to the timeseries buckets (e.g. `system.buckets.myColl`). This mismatch will cause the shard version protocol to fail and potentially never converge, making a mongos impossible to serve explain findAndModify commands for that specific collection.
As part of this ticket, we should make sure we have enough coverage for rawData explain over a timeseries sharded collection.
- causes
-
SERVER-114329 Fix namespace check for findAndModify explain in timeseries_raw_data_with_collection_recreation.js
-
- Closed
-
- is caused by
-
SERVER-100929 Support explain with rawData for the findAndModify command
-
- Closed
-
- related to
-
SERVER-114214 Fix legacy timeseries namespace translation in write explain commands
-
- Closed
-
-
SERVER-117166 Perform shard version check only after translating timeseries namespace in findAndModify explain
-
- Closed
-
-
SERVER-114161 Re-enable test findAndModify explain test case for legacy timeseries collections
-
- Open
-
-
SERVER-114202 Attach the namespace as a ShardVersion field for testing
-
- Closed
-