Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54457

Resharding state transition log messages show misleading oldState attribute

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2021-03-08
    • 1

      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

            Assignee:
            haley.connelly@mongodb.com Haley Connelly
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: