When a write is targeted, we try to ensure the target database is created by using the cluster DDL API. However, this API only tries once, so the following scenario is totally plausible:
- A write arrives to a router, it uses cluster::createDatabase to create the new database
- A drop database arrives to the same router, and manages to commit before the collection refresh in the insert path
- The insert fails with NamespaceNotFound
We should retry the database creation until it succeeds in the targetter.
- is depended on by
-
SERVER-84043 Enable drop_database_before_write_is_targeted test on multi-version suites
- Open
- related to
-
SERVER-84171 findAndModify command may fail with NamespaceNotFound if the database is concurrently dropped
- Closed