Operational Defect Database

BugZero found this defect 130 days ago.

MongoDB | 2541863

Sharded multi-document transactions can observe partial effects of concurrent DDL operations

Last update date:

3/11/2024

Affected products:

MongoDB Server

Affected releases:

7.0.0

Fixed releases:

7.0.6

8.0.0-rc0

7.2.2

7.3.0-rc4

Description:

Info

Consider the following interleaving (repro1.js): 1. Initial state: collA: sharded collection with chunks both on shard0 and shard1. collB: unsharded collection on shard0. collC: does not exist. 2. Start txn with local or majority read concern, hit shard0 to read collB [shard0's txn snapshot has: ns1 and ns2] 3. Rename collA -> collC. 4. Read collC. On shard0, collC does not exist in the txn snapshot. On shard1 it will. Therefore the txn will see half the collection. Moreover, if collectionC existed initially, the transaction would observe a mix of the original collection and the post-rename collection. The example above involves rename, but a similar situation might be possible with reshardCollection. Another anomaly is (repro2.js): 1. Initial state shard0 (dbPrimary): collA(sharded) and collB(unsharded) shard1: collA(sharded) 2. Start txn (local, majority or snapshot read concern), hit shard0 for collB 3. Drop collA 4. Read collA. Will target shard0, will read the sharded coll (but just half of it).

Top User Comments

xgen-internal-githook commented on Thu, 22 Feb 2024 16:32:04 +0000: Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'} Message: SERVER-84723 Ensure sharding catalog is valid when acquiring collections in multi-document transactions (#18193) GitOrigin-RevId: fdfa7f0e5d4bf026af4d3990bc2bdaa604945a55 Branch: v7.3 https://github.com/mongodb/mongo/commit/e156c060331493feb6d128826740cec0508f6aee xgen-internal-githook commented on Thu, 22 Feb 2024 00:37:44 +0000: Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'} Message: SERVER-84723 Ensure sharding catalog is valid when acquiring collections in multi-document transactions (#18193) Branch: v7.2 https://github.com/mongodb/mongo/commit/864ace1cd2e56d5234e77f2d897a7296d5b00f0c xgen-internal-githook commented on Thu, 8 Feb 2024 14:50:30 +0000: Author: {'name': 'Jordi Serra Torrens', 'email': 'jordist@users.noreply.github.com', 'username': 'jordist'} Message: SERVER-84723 Sharded multi-document transactions can observe partial effects of concurrent DDL operations (#18598) GitOrigin-RevId: fc44cbf07b29fbc1201f3beb40a3d3135266247a Branch: v7.0 https://github.com/mongodb/mongo/commit/a21af87f901e29bf2763ffb06e5d492cc2e722ac xgen-internal-githook commented on Wed, 31 Jan 2024 16:49:47 +0000: Author: {'name': 'Jordi Serra Torrens', 'email': 'jordist@users.noreply.github.com', 'username': 'jordist'} Message: SERVER-84723 Ensure sharding catalog is valid when acquiring collections in multi-document transactions (#18193) GitOrigin-RevId: 3a7b1e4f29dfae062ad1ef904280a1e40d0a411c Branch: master https://github.com/mongodb/mongo/commit/03be106d1749971acc549bfc827e3d59da57f526

Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Closed

Learn More

Search:

...