[SERVER-71477] Check '_internalAllCollectionStatsSpec.getStats()' exists (boost::optional) before calling 'makeStatsForNs' in 'document_source_internal_all_collection_stats.cpp' Created: 18/Nov/22  Updated: 29/Oct/23  Resolved: 22/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.1, 6.0.4, 6.2.0-rc2, 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Pol Pinol Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
is caused by SERVER-69465 Accept same specs for $_internalAllCo... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.2, v6.1, v6.0
Sprint: Sharding EMEA 2022-11-28
Participants:
Linked BF Score: 143

 Description   

In order to solve this bug we must check that '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs' in 'document_source_internal_all_collection_stats.cpp':

if (const auto& specs = _internalAllCollectionStatsSpec.getStats()) {
    try {
        return {Document{DocumentSourceCollStats::makeStatsForNs(
            pExpCtx, nss, specs.get(), _projectFilter)}};
    } catch (const ExceptionFor<ErrorCodes::CommandNotSupportedOnView>&) {
       continue;
    }
}



 Comments   
Comment by Githook User [ 24/Nov/22 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-71477 Check '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs'
Branch: v6.0
https://github.com/mongodb/mongo/commit/1557a827b0ea179cf64b3e4139169033e2181a59

Comment by Githook User [ 24/Nov/22 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-71477 Check '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs'
Branch: v6.1
https://github.com/mongodb/mongo/commit/1d72b538dd9696f14e01bec6589ee533cb0bee32

Comment by Githook User [ 24/Nov/22 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-71477 Check '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs'
Branch: v6.2
https://github.com/mongodb/mongo/commit/ad2b7e93f1e05bc0512d93d03db45a4139e20bb2

Comment by Githook User [ 22/Nov/22 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-71477 Check '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs'
Branch: master
https://github.com/mongodb/mongo/commit/9ce93ef6b1fe85eed2a14930ce87b201a44fd5e6

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