[SERVER-83146] Bulk write operation might fail with NamespaceNotFound Created: 10/Nov/23  Updated: 28/Dec/23  Resolved: 12/Dec/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 7.3.0-rc0, 6.0.13, 5.0.24, 7.0.6

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Antonio Fuschetto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File BF-30687.patch    
Issue Links:
Backports
Depends
is depended on by SERVER-84043 Enable drop_database_before_write_is_... Open
Related
related to SERVER-84171 findAndModify command may fail with N... Open
Assigned Teams:
Catalog and Routing
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0, v6.0, v5.0, v4.4
Steps To Reproduce:
  1. Apply the patch attached in commit version eab80c5be
Sprint: CAR Team 2023-12-11, CAR Team 2023-12-25
Participants:
Linked BF Score: 7
Story Points: 1

 Description   

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:

  1. A write arrives to a router, it uses cluster::createDatabase to create the new database
  2. A drop database arrives to the same router, and manages to commit before the collection refresh in the insert path
  3. The insert fails with NamespaceNotFound

We should retry the database creation until it succeeds in the targetter.



 Comments   
Comment by Githook User [ 21/Dec/23 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-83146 Bulk write operation might fail with `NamespaceNotFound`

GitOrigin-RevId: 21d764a80633332e1e7cdeec1af06da92766ca3b
Branch: v6.0
https://github.com/mongodb/mongo/commit/0e647ff33b6963b54b4c7084085d6258fb006f6d

Comment by Githook User [ 21/Dec/23 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-83146 Bulk write operation might fail with `NamespaceNotFound`

GitOrigin-RevId: d137dddedaf754721dbcdc53c4994948b1125e31
Branch: v7.0
https://github.com/mongodb/mongo/commit/1de5567805367a11c4d77d67868a11ca02e192e3

Comment by Githook User [ 21/Dec/23 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-83146 Bulk write operation might fail with `NamespaceNotFound`

GitOrigin-RevId: 68f817e56545aa19fdae1e4d437af3897a40a6d3
Branch: v5.0
https://github.com/mongodb/mongo/commit/26d5d8b3b664921abbdbf664606daf5623b13030

Comment by Githook User [ 12/Dec/23 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-83146 Bulk write operation might fail with `NamespaceNotFound`

GitOrigin-RevId: 9eea1836e47c9ee7ae5287669961eb44776a8d18
Branch: master
https://github.com/mongodb/mongo/commit/fa341e1f21aa5b1a256b0ed27b03293fb457e771

Comment by Josef Ahmad [ 22/Nov/23 ]

Summarising some aspects we've covered offline (cc: kaloian.manassiev@mongodb.com allison.easton@mongodb.com marcos.grillo@mongodb.com jordi.serra-torrens@mongodb.com):

  • This behaviour may apply to any write and it's not necessarily specific to bulk writes
  • We suspect this behaviour has existed since virtually forever. Marcos reproduced it on 6.0
Generated at Thu Feb 08 06:51:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.