[SERVER-86116] CreateCollectionCoordinator may fail to create the chunk metadata on commit time. Created: 02/Feb/24  Updated: 07/Feb/24  Resolved: 07/Feb/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 7.0.5
Fix Version/s: 7.0.6

Type: Bug Priority: Major - P3
Reporter: Paolo Polato Assignee: Paolo Polato
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-80363 server default writeConcern is not ho... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: CAR Team 2024-02-05, CAR Team 2024-02-19
Participants:
Linked BF Score: 9

 Description   

SERVER-80363 introduced changes to the way the write concern for a batch write request has to be applied. This introduced a regression in the execution of a shardCollection operation, which sends a BatchedCommandRequest to the config server for committing the chunk list of the targeted namespace: since such a logic sets the majority write concern on the request object without also configuring the opCtx used for its submission, the config server ends up applying the w:1 default value.

This may lead to a situation of metadata inconsistency on the config server through the following sequence:

  1. createCollectionCoordinator requests the creation of the collections chunks through BatchedCommandRequest as the 1st step of the DDL commit
  2. the config server performs the batch write and returns an OK result to the coordinator as soon as writes are persisted by the primary node
  3. the config server steps down before step 1 gets replicated; the list of chunks gets hence rolled back
  4. createCollectionCoordinator receives the OK about step 1, and proceed to commit the rest of the metadata on the config server (subsequents requests are server by the new CSRS primary)
  5. createCollectionCoordinator considers the metadata commit as complete, but at the first attempt of refreshing its cached copy of the routing table it will detect the inconsistency.


 Comments   
Comment by Githook User [ 07/Feb/24 ]

Author:

{'name': 'ppolato', 'email': '82828243+ppolato@users.noreply.github.com', 'username': 'ppolato'}

Message: SERVER-86116 Fix write concern configuration on insertChunks() helper of CreateCollectionCoordinator (#18686)

GitOrigin-RevId: 0c8994973c924987453c1f4beff3809aaf14bc01
Branch: v7.0
https://github.com/mongodb/mongo/commit/88d229cdeef6ba9dbb115550cceee0e87162facb

Generated at Thu Feb 08 06:59:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.