Operational Defect Database

BugZero found this defect 32 days ago.

MongoDB | 2645577

Retryable writes during resharding may execute more than once if chunk migration follows the reshard operation

Last update date:

4/17/2024

Affected products:

MongoDB Server

Affected releases:

5.0.0

6.0.0

7.0.0

7.3.0

8.0.0-rc2

Fixed releases:

No fixed releases provided.

Description:

Info

Resharding preserves the full retryability history for any retryable writes which occur during the resharding operation. If a chunk migration follows the resharding, session migration should transfer the relevant write history over to the recipient of the chunk. The way chunk migration checks for whether an oplog is relevant is by filtering on the namespace being migrated. The problem is that when resharding recipients update their config.transactions table (based on the retryable writes/transactions performed on the donor shard), it creates a noop oplog entry with the namespace set to empty. If the resharding recipient then becomes the donor in the following chunk migration, due to the empty namespace, it will incorrectly conclude that this oplog entry isn't relevant to the chunk actively being migrated. As a result, the noop oplog entry for the already executed retryable write never gets migrated and the retryable write could be executed again after the chunk migration commits. Adding Max's repro for this issue: Start a resharding operation Run a retryable $inc update during the resharding operation Resharding operation completes Run chunk migration Retry retryable write from (2) and verify no new oplog entry was generated

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...