Rename collection across DBs is split into two phases:
- Data copy from the source collection to a temporary collection on the target DB
- Commit by renaming the temporary collection on the target and dropping the source
Before SERVER-99621 we released all the locks between data copy and commit, which as a side effect releases the snapshot we acquired for the data copy. However since SERVER-99621, we keep holding the DB locks, which prevents this.
The code for the commit is designed to work on the latest state, and invariants if the target collection was dropped after we acquired the snapshot. So we should release the snapshot.