-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Catalog and Routing
-
Fully Compatible
-
CAR Team 2026-07-20
-
1
-
🟦 Shard Catalog
-
None
-
None
-
None
-
None
-
None
-
None
In the $out stage, isRawDataOperation is manually set to true before calling createIndexesOnEmptyCollection and reset to false afterward. If createIndexesOnEmptyCollection throws, the reset is skipped and the flag is left as true on the OperationContext.
Replace the manual set/reset pattern with a RAII guard that saves the original value, sets the override, and restores the original value on destruction (including on exception). The guard should be defined alongside isRawDataOperation in raw_data_operation.h so it can be reused by other call sites if needed.