[SERVER-58395] Resharding metrics should set donorState/RecipientState to kUnused if they are not initialized for currentOp report. Created: 09/Jul/21  Updated: 29/Oct/23  Resolved: 09/Jul/21

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

Type: New Feature Priority: Major - P3
Reporter: Kshitij Gupta Assignee: Kshitij Gupta
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Sharding 2021-07-12
Participants:
Linked BF Score: 144

 Description   

When a shard is a donor and a recipient, it is possible to get into a state with a currentOp instance without one of donorState or recipientState set. Currently resharding metrics does not account for this and tries to dereference the uninitialized boost::optional  for donorState/recipientState causing a failure when building a currentOp report. To fix this, we can check whether donorState/recipientState are uninitialized and if so, use kUnused as the state to build the currentOp report.



 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 [ 26/Jul/21 ]

Author:

{'name': 'Kshitij Gupta', 'email': 'kshitij.gupta@mongodb.com', 'username': 'kshitijng'}

Message: SERVER-58395: Resharding metrics should set donorState/RecipientState to kUnused if they are not initialized for currentOp report.

(cherry picked from commit 321032021822297b6135cee97780ebfb8651eceb)
Branch: v5.0
https://github.com/mongodb/mongo/commit/e1cd49482c88e06167dc445cb44f63d3115b36c8

Comment by Githook User [ 09/Jul/21 ]

Author:

{'name': 'Kshitij Gupta', 'email': 'kshitij.gupta@mongodb.com', 'username': 'kshitijng'}

Message: SERVER-58395: Resharding metrics should set donorState/RecipientState to kUnused if they are not initialized for currentOp report.
Branch: master
https://github.com/mongodb/mongo/commit/321032021822297b6135cee97780ebfb8651eceb

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