Operational Defect Database

BugZero found this defect 107 days ago.

MongoDB | 2564920

CreateCollectionCoordinator may fail to create the chunk metadata on commit time.

Last update date:

3/15/2024

Affected products:

MongoDB Server

Affected releases:

5.0.0

6.0.0

7.0.5

Fixed releases:

7.0.6

Description:

Info

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: createCollectionCoordinator requests the creation of the collections chunks through BatchedCommandRequest as the 1st step of the DDL commit 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 the config server steps down before step 1 gets replicated; the list of chunks gets hence rolled back 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) 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.

Top User Comments

xgen-internal-githook commented on Wed, 7 Feb 2024 16:11:50 +0000: 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

Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Closed

Learn More

Search:

...