In $merge track InsertStats also for updates

    • 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

      Currently when using insert with backup strategy, introduced in SERVER-109034, $merge tracks the amount of inserted documents and insertion errors.

      This is done to stop inserting and go straight to updating when insertions are not efficient.

      After the strategy goes directly to update, it will never go back to insertion.

      But update command reports the amount of matched documents vs upserted documents.

      We can use this to continue tracking the stats and go back to inserting if error rate falls back.

      For example, if we $merge documents, order by time, we can begin with updating, but when we pass some threshold, we will be mostly inserting.

            Assignee:
            Unassigned
            Reporter:
            Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: