[SERVER-57153] Support co-existing donors/recipients in resharding metrics Created: 24/May/21  Updated: 29/Oct/23  Resolved: 03/Jun/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.0.0-rc1, 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Blake Oler Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-autocommits, post-rc0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
causes SERVER-61473 Resharding coordinator calls Reshardi... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Sharding 2021-06-14, Sharding 2021-05-31
Participants:
Story Points: 1

 Description   

Background

The metrics class expects only one resharding operation node type to be active at once for a particular process. This is a problem on processes that have both donors and recipients. It causes issues with both double-starting and the “quicker” node type ending the operation before the “slower” node type is finished.

Proposed Solution

  1. Change the participant state enums to be boost::optionals
  2. onStart will emplace a state enum with kUnused***
  3. onStart will check for an emplaced donor/recipient and allow no-op if the other type is already emplaced. If any other combination of enum types is placed down, it will trip an invariant.
  4. onCompletion/onStepDown will only remove the enum for that particular node type, letting the last node type to quit truly shut down the metrics system.
  5. onCompletion/onStepDown will only take its expected actions if it is the last node type existing on that process for the resharding operation.

***You’d think that we can just increment the state past kUnused to indicate that a donor/recipient is active on the process, but the way metrics are written, the state can’t be incremented until it’s been persisted on disk. The metrics system is started before any state changes are persisted on disk, so making the state enums optional is our way of satisfying the state transition ordering.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 03/Jun/21 ]

Author:

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

Message: SERVER-57153 Support co-existing donors/recipients in resharding metrics

(cherry picked from commit 83fea20e50872158c620b0eef720a77a173f176a)
Branch: v5.0
https://github.com/mongodb/mongo/commit/66bf2823f5e8149147c05c7e4bbc29c1eab3692c

Comment by Githook User [ 01/Jun/21 ]

Author:

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

Message: SERVER-57153 Support co-existing donors/recipients in resharding metrics
Branch: master
https://github.com/mongodb/mongo/commit/83fea20e50872158c620b0eef720a77a173f176a

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