[SERVER-55434] Log when Resharding Donor/Recipient coordinator updates are unsuccessful Created: 22/Mar/21  Updated: 29/Oct/23  Resolved: 17/Jun/21

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

Type: Task Priority: Major - P3
Reporter: Haley Connelly Assignee: Haley Connelly
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Sharding 2021-06-28
Participants:
Story Points: 1

 Description   

Since SERVER-53506 ReshardingDonorService/ReshardingRecipientService only update the coordinator if the coordinator document on the configsvr matches a predicate about the participants previously reported state.

If the update is stale, it doesn't occur.

For testing/ debugging purposes, it would be nice to log debug message when the update updates 0 documents (similar to what is done in the ReshardingCoordinatorService but logging instead of throwing since it is not a correctness issue)



 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 [ 17/Jun/21 ]

Author:

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

Message: SERVER-55434 Log when Resharding Donor/Recipient coordinator updates are unsuccessful

(cherry picked from commit ec2596290a3a598b6f6ae1ec2097632f32fad563)
Branch: v5.0
https://github.com/mongodb/mongo/commit/31db79992b4b2b23ca617b614930bc6777a671fe

Comment by Githook User [ 16/Jun/21 ]

Author:

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

Message: SERVER-55434 Log when Resharding Donor/Recipient coordinator updates are unsuccessful
Branch: master
https://github.com/mongodb/mongo/commit/ec2596290a3a598b6f6ae1ec2097632f32fad563

Comment by Haley Connelly [ 25/Mar/21 ]

Putting this in a comment since I already did it for debugging but editing the resharding recipient machine isn't necessarily within the scope of my current ticket. 

Inside updateCoordinatorDocument we uassertStatusOK(catalogClient->updateConfigDocument(....)) 

The updateConfigDocument returns a statusWith<Bool> which, Status::OK(), returns whether the update command's response update.n value is > 0.

All we need to do is check if the value returned is false, and if so, log a debug message. 

eg

    void updateCoordinatorDocument(OperationContext* opCtx,
                                   const BSONObj& query,
                                   const BSONObj& update) override {
        auto catalogClient = Grid::get(opCtx)->catalogClient();
        auto res = catalogClient->updateConfigDocument(
            opCtx,
            NamespaceString::kConfigReshardingOperationsNamespace,
            query,
            update,
            false, /* upsert */
            ShardingCatalogClient::kMajorityWriteConcern);
        uassertStatusOK(res);
        if (!res.getValue()) {
            // log debug statement here
        }
    }

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