-
Type:
Sub-task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
Add a skip_stream function pointer to MongoExtensionLogicalAggStageVTable in api.h, wire the host adapter to forward it, and add the corresponding virtual method to the SDK's LogicalAggStage base class.
Background
When the host's DocumentSourceDocumentResultsAndMetadata::optimizeAt() determines that $$SEARCH_META is not referenced downstream, it calls skip_stream(kMetadataResult) on the extension's logical stage. The extension uses this notification to omit metadata cursor establishment during open(), avoiding unnecessary facet collection in mongot.
Scope of Work
- api.h: add skip_stream to MongoExtensionLogicalAggStageVTable:
MongoExtensionStatus* (*skip_stream)(MongoExtensionLogicalAggStage* logicalStage, int32_t streamType);
- logical_agg_stage_adapter.cpp: implement _extSkipStream forwarding function
- SDK (aggregation_stage.h): add virtual void skipStream(int32_t streamType) {} to LogicalAggStage base class with a no-op default; ExtensionLogicalAggStageAdapter wires _extSkipStream to call it
Acceptance Criteria
- Host can call skip_stream through the C API without error
- Extension subclasses can override skipStream() to record the flag
- Default no-op implementation means single-stream extensions are unaffected
- Unit tests verify forwarding from host through adapter to SDK
- is depended on by
-
SERVER-126007 Implement metadata elision optimization for $_internalDocumentResultsAndMetadata
-
- In Code Review
-