[SERVER-71328] Ensure correct filtering metadata on donor shard after multiple failures Created: 14/Nov/22  Updated: 29/Oct/23  Resolved: 06/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.13, 6.0.2, 6.1.0-rc4, 6.2.0-rc0
Fix Version/s: 6.3.0-rc0, 6.0.5, 5.0.16

Type: Bug Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.2, v6.0, v5.0
Steps To Reproduce:

Since the configOpTime known to P1 is not inclusive of the latest committed migration, there is no guarantee that any subsequent refresh of the filtering metadata would include the committed migration.

Sprint: Sharding EMEA 2022-12-12, Sharding EMEA 2022-12-26, Sharding EMEA 2023-01-09
Participants:

 Description   

The donor of a chunk migration calls ShardingStateRecovery::endMetadataOp() that is persisting the configOpTime inclusive of the migration commit, this is to ensure that in case of stepdown when the next primary node will read from the config server it will see the effect of the commit performed by the previous primary.

The problem is that endMetadataOp() is not called after recovering a failed migration, so in case the donor experiences an error during the commit (network error) and a subsequent stepdown, there is no guarantee that the next primary node will install the correct filtering metadata inclusive of the last migration.

The proposed solution is to add a VectorClock::waitForDurableConfigTime() just before writing down the commit decision in the migration coordinator document.
This will be execute both if no error occur during the commit as well as during migration recovery.



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

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-71328 Ensure correct filtering metadata on donor shard after multiple failures

(cherry picked from commit f782ca31ce08c7b0ec04a29eac3338884338a337)
(cherry picked from commit fd8260fc72cbe43f4addeab7bada2a87b05fb28c)
Branch: v5.0
https://github.com/mongodb/mongo/commit/ef86c9f8322eaef228c36cebc9a990686dff3a40

Comment by Githook User [ 12/Jan/23 ]

Author:

{'name': 'toto', 'email': '58224719+toto-dev@users.noreply.github.com', 'username': 'toto-dev'}

Message: SERVER-71328 Ensure correct filtering metadata on donor shard after multiple failures

(cherry picked from commit f782ca31ce08c7b0ec04a29eac3338884338a337)
Branch: v6.0
https://github.com/mongodb/mongo/commit/fd8260fc72cbe43f4addeab7bada2a87b05fb28c

Comment by Githook User [ 05/Jan/23 ]

Author:

{'name': 'toto', 'email': '58224719+toto-dev@users.noreply.github.com', 'username': 'toto-dev'}

Message: SERVER-71328 Ensure correct filtering metadata on donor shard after multiple failures
Branch: master
https://github.com/mongodb/mongo/commit/f782ca31ce08c7b0ec04a29eac3338884338a337

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