-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In SERVER-109034 $merge introduced an insert-with-backup strategy that tries to insert documents first and in case of DuplicateKeyError, retries the operation with update instead.
This operation can switch back to pure updates if insert error rate is too high.
There are knobs to control the thresholds when this happens, which can be tuned to match the specific user workload.
Currently there is no insight into what actually happens inside $merge.
We should consider adding some debug logs to be able to guide tuning process, if needed.
For example: every time we flush a batch in $merge, we can log: size of the batch, the number of insertion errors, total number of processed documents, total number of insert errors.
- is related to
-
SERVER-109034 $merge execution uses update when insert may be more efficient
-
- Closed
-