[SERVER-54457] Resharding state transition log messages show misleading oldState attribute Created: 10/Feb/21  Updated: 29/Oct/23  Resolved: 24/Feb/21

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

Type: Bug Priority: Minor - P4
Reporter: Max Hirschhorn Assignee: Haley Connelly
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-54000 Make errors propagate from the Reshar... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-03-08
Participants:
Story Points: 1

 Description   

The DonorStateMachine and RecipientStateMachine log message for state transitions are reporting the new state as the oldState attribute. This is because the _donorDoc.getState() and _recipientDoc.getState() refer to the state after the document has been updated in-memory. The ReshardingCoordinator happens to update the document in-memory after logging the message.

[js_test:resharding_clones_initial_data] 2021-02-10T17:07:17.126+0000 c21774| 2021-02-10T17:07:17.124+00:00 I  RESHARD  5343001 [ReshardingCoordinatorService-0] "Transitioned resharding coordinator state","attr":{"newState":"initializing","oldState":"unused","ns":"reshardingDb.coll","collectionUUID":{"uuid":{"$uuid":"515a07af-37cc-4088-93fa-a89f0c23b5bc"}},"reshardingUUID":{"uuid":{"$uuid":"a8500551-7e7b-4d0a-8541-0aecab3098ee"}}}
...
[js_test:resharding_clones_initial_data] 2021-02-10T17:07:17.268+0000 d21770| 2021-02-10T17:07:17.256+00:00 I  RESHARD  5279505 [ReshardingDonorService-0] "Transitioned resharding donor state","attr":{"newState":"donating-initial-data","oldState":"donating-initial-data","ns":"reshardingDb.coll","collectionUUID":{"uuid":{"$uuid":"515a07af-37cc-4088-93fa-a89f0c23b5bc"}},"reshardingUUID":{"uuid":{"$uuid":"a8500551-7e7b-4d0a-8541-0aecab3098ee"}}}
...
[js_test:resharding_clones_initial_data] 2021-02-10T17:07:17.388+0000 d21772| 2021-02-10T17:07:17.387+00:00 I  RESHARD  5279506 [ReshardingRecipientService-1] "Transitioned resharding recipient state","attr":{"newState":"cloning","oldState":"cloning","ns":"reshardingDb.coll","collectionUUID":{"uuid":{"$uuid":"515a07af-37cc-4088-93fa-a89f0c23b5bc"}},"reshardingUUID":{"uuid":{"$uuid":"a8500551-7e7b-4d0a-8541-0aecab3098ee"}}}

https://logkeeper.mongodb.org/lobster/build/4886a77b00cb34b6bdbee5b4e1ecf5a6/test/602412b7c2ab68531c0010db#bookmarks=0%2C5230&f~=100~Transitioned%20resharding&l=1



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

Author:

{'name': 'Haley Connelly', 'email': 'haley.connelly@mongodb.com', 'username': 'haleyConnelly'}

Message: SERVER-54000 Make errors propagate from the ReshardingCoordinator to participants

SERVER-54457 Resharding state transition log messages use correct 'oldState'
Branch: master
https://github.com/mongodb/mongo/commit/6abf5d917e5f5aac880c3201c17bf6749ddd2f55

Comment by Haley Connelly [ 11/Feb/21 ]

Doing this as a part of SERVER-54000

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