-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: 5.0.0, 6.0.0, 7.0.0-rc0
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
Sharding EMEA 2023-05-01
-
135
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
When shardsvr_rename_collection_participant command is called, first it calls getOrCreate, which returns an instance of a {{renameCollectionParticipant }}running asynchronously, then it checks if the parameters of the request are the same than the parameters of the given instance (to ensure idempotency).
Since the check is done while the renameCollectionParticipant is being executed on another thread, there is a data race over _doc attribute:
- During the check we read _doc
- The renameCollectionParticipant::run operation updates _doc.
CONSEQUENCES OF THE BUG:
In case of reading a defective _doc value due to a data race the DDL coordinator will retry the command here.
A suggestion to fix this bug is to add a const attribute (which could be called _request) and initiate it on the constructor using the _doc value, similar to what RenameCollectionCoordinator already does (1) (2).