[SERVER-60944] Change interface for updateWithSuppliedFacet and update Created: 22/Oct/21  Updated: 29/Oct/23  Resolved: 21/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0, 4.4.12

Type: Task Priority: Major - P3
Reporter: Lamont Nelson Assignee: Davis Haupt (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.2, v4.4
Participants:
Story Points: 2

 Description   

Currently, we have the following code located here:

    auto container = getOrCreateFaultFacetsContainer();
    auto facet = container->getFaultFacet(checkStatus.getType());
    if (!facet) {
        const auto type = checkStatus.getType();
        auto newFacet =
            new FaultFacetImpl(type, _svcCtx->getFastClockSource(), std::move(checkStatus));
        container->updateWithSuppliedFacet(type, FaultFacetPtr(newFacet));
    } else {
        facet->update(std::move(checkStatus));
    }

Meaning that in order to update a health check result we need to know about two different functions facet->update and container->updateWithSuppliedFacet. We should collapse this to one function, update, such that it will automatically created the facet if needed.



 Comments   
Comment by Githook User [ 15/Feb/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-60944 Simplify Fault class hierarchy and interface for updating fault facets

(cherry picked from commit 3b11d6fa60ff69f9ae52a90690cd05404625284e)
Branch: v5.2
https://github.com/mongodb/mongo/commit/20fb4754a4b5babe391ccefb47902049ae58fe3e

Comment by Githook User [ 29/Dec/21 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-60944 Simplify Fault class hierarchy and interface for updating fault facets

(cherry picked from commit 3b11d6fa60ff69f9ae52a90690cd05404625284e)
Branch: v4.4
https://github.com/mongodb/mongo/commit/7fb0f31550e53174aac9f54d98d2bf900e3444db

Comment by Githook User [ 20/Dec/21 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-60944 Simplify Fault class hierarchy and interface for updating fault facets
Branch: master
https://github.com/mongodb/mongo/commit/3b11d6fa60ff69f9ae52a90690cd05404625284e

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