[SERVER-54048] Recipient shards in resharding may end up creating a DonorStateMachine upon refresh Created: 26/Jan/21  Updated: 29/Oct/23  Resolved: 03/Feb/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: PM-234-M2.5, PM-234-T-lifecycle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-02-08
Participants:
Story Points: 1

 Description   

d20028 is a recipient shard, but it ends up constructing a DonorStateMachine after refreshing the existing sharded collection namespace. It seems like processReshardingFieldsForCollection() is missing a check that the shard the refresh occurred on also owns at least one chunk for the sharded collection with resharding fields present.

[js_test:resharding_fuzzer-4c289-1611626796463-5] 2021-01-26T02:09:47.040+0000 d20028| 2021-01-26T02:09:47.038+00:00 I  SH_REFR  4619901 [CatalogCache-0] "Refreshed cached collection","attr":{"namespace":"test_reshard.reshard_coll","newVersion":{"chunkVersion":{"0":{"$timestamp":{"t":2,"i":2}},"1":{"$oid":"600f79e68d07bbaf181e3b42"}},"forcedRefreshSequenceNum":1,"epochDisambiguatingSequenceNum":1},"oldVersion":{"chunkVersion":"None","forcedRefreshSequenceNum":0,"epochDisambiguatingSequenceNum":0},"durationMillis":3}
[js_test:resharding_fuzzer-4c289-1611626796463-5] 2021-01-26T02:09:47.040+0000 d20028| 2021-01-26T02:09:47.038+00:00 I  STORAGE  20320   [ReshardingDonorService-0] "createCollection","attr":{"namespace":"config.localReshardingOperations.donor","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"450e099a-4dfc-48b2-ba80-f9d2d646a9d4"}},"options":{}}
[js_test:resharding_fuzzer-4c289-1611626796463-5] 2021-01-26T02:09:47.073+0000 d20028| 2021-01-26T02:09:47.069+00:00 I  STORAGE  20320   [ShardServerCatalogCacheLoader::runCollAndChunksTasks] "createCollection","attr":{"namespace":"config.cache.chunks.test_reshard.reshard_coll","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"9ca3a2d3-2f67-4a13-8b02-cecb436a0e60"}},"options":{}}
...
[js_test:resharding_fuzzer-4c289-1611626796463-5] 2021-01-26T02:09:47.343+0000 d20028| 2021-01-26T02:09:47.303+00:00 I  MIGRATE  5279505 [ReshardingDonorService-0] "Transition resharding donor state","attr":{"newState":"donating-initial-data","oldState":"preparing-to-donate","reshardingUUID":{"uuid":{"$uuid":"c67a9257-26ec-45f3-867a-bdf9d717f633"}}}
[js_test:resharding_fuzzer-4c289-1611626796463-5] 2021-01-26T02:09:47.356+0000 d20030| 2021-01-26T02:09:47.329+00:00 I  MIGRATE  5279505 [ReshardingDonorService-0] "Transition resharding donor state","attr":{"newState":"donating-initial-data","oldState":"preparing-to-donate","reshardingUUID":{"uuid":{"$uuid":"c67a9257-26ec-45f3-867a-bdf9d717f633"}}}
[js_test:resharding_fuzzer-4c289-1611626796463-5] 2021-01-26T02:09:48.020+0000 d20026| 2021-01-26T02:09:48.019+00:00 I  MIGRATE  5279506 [ReshardingRecipientService-0] "Transition resharding recipient state","attr":{"newState":"steady-state","oldState":"applying","reshardingUUID":{"uuid":{"$uuid":"c67a9257-26ec-45f3-867a-bdf9d717f633"}}}

https://logkeeper.mongodb.org/lobster/build/58d1892f964e7d6658fd78c5f3211b2a/test/600f79debe07c40af53aafdf#bookmarks=0%2C34304%2C34305%2C34445%2C35138%2C35235%2C36672%2C54595%2C55641%2C59776&f~=000~%5C%5BResharding.%2AService&f~=000~%5C%5BResharding&f~=000~d20028%5C%7C&f~=100~d20028%5C%7C.%2AReshardingDonorService&l=1



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

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-54048 Ensure shard owns chunks for collection before creating resharding state machines
Branch: master
https://github.com/mongodb/mongo/commit/58660a217de99710cc43c78c0381f24cb20961e6

Generated at Thu Feb 08 05:32:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.