[SERVER-75589] Make `mirrorResponseCallback` handle cancellation at shutdown Created: 03/Apr/23  Updated: 29/Oct/23  Resolved: 20/Apr/23

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2023-04-17, Service Arch 2023-05-01
Participants:
Linked BF Score: 20

 Description   

The mirroring sub-system has a test-only feature to verify completion of mirrored operations, and terminate the process if a mirrored read fails to execute:

auto mirrorResponseCallback = [host](auto& args) {
    if (MONGO_likely(!mirrorMaestroExpectsResponse.shouldFail())) {
        // If we don't expect responses, then there is nothing to do here
        return;
    }
    ...
    if (ErrorCodes::isRetriableError(args.response.status)) {
        ...
    } else if (!args.response.isOK()) {
        LOGV2_FATAL(4717301, "Received mirroring response with a non-okay status", "error"_attr = args.response);
    }
};

This logic doesn't handle cancellations at shutdown. We should make mirrorResponseCallback aware of the state of the mirroring subsystem and treat cancellations differently (e.g., logging at "INFO" level). Also, we should have the log statement include the HostAndPort of the target.



 Comments   
Comment by Githook User [ 19/Apr/23 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-75589 Make 'mirrorResponseCallback' handle cancellation at shutdown
Branch: master
https://github.com/mongodb/mongo/commit/f534a8ba34a0ef4c80cd222df28f22e5a62bc284

Generated at Thu Feb 08 06:30:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.