The new refineCollectionShardKey implementation introduced by SERVER-76486 contains an idempotency check, however, in case of a config server stepdown, it is possible that this check passes due to the commit not being fully applied yet.
SERVER-79064 removed the old refine collection shard key code, however, it made a second idempotency check a tassert, this is not necessary, in fact, if the collection was not found, we could actually assume that the commit already happened, considering the find command is checking the old collection timestamp.
We should make sure to detect and handle any idempotency situations with either as a no-op commit or a retriable error, but never triggering a tassert. An option would be to remove that tassert, and make the entire commit a no-op if no collection is found with that timestamp, making the commit command idempotent.
- is caused by
-
SERVER-79064 Remove refine collection shard key deprecated code once 8.0 becomes last lts
- Closed