-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
DocumentSource::usedDisk() is (subjectively) expected to be const, however it is not.
Most stages cannot spill to disk, so the result is always false.
Some stages can spill and the method returns _stats.planSummaryStats.usedDisk, where _stats is some stage specific statistics object, which can also be retrieved with DocumentSource::getSpecificStats() method.
Some stages with sub-pipelines don't update their statistics during the execution, within the usedDisk() non-const method, which makes the API contextual and prone to errors.
Updating _stats.planSummaryStats.usedDisk should probably be done when the pipeline is officially 'closed' and there will be no more 'getNext()' calls. This will allow making DocumentSource::usedDisk() method const, or remove it completely, as suggested in SERVER-53759.
This minor improvement is related to SPM-4106, but it is out of scope of the project.
- is related to
-
SERVER-53759 Remove DocumentSource::usedDisk()
-
- Backlog
-