$out leaves the temp collection behind if the primary steps down for viewful timeseries

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This is only a bug for viewful timeseries. This bug occurs when

      1. On a sharded cluster writing to a viewful timeseries collection
      2. $out is running on a secondary
      3. $out starts writing to a temp buckets collection
      4. An election happens and a new primary steps up. On stepup the $out temporary collections are dropped by an dropAggTempCollections command.
      5. $out continues running and will start targeting inserts to the new primary. However, since the temp buckets collection doesn't exist anymore, we will treat these inserts as non-timeseries inserts and implicitly recreate the temp collection without the system.buckets prefix.
      6. $out errors when trying to rename the collection since it tries to rename the system.buckets temp collection and it can't find it, since the collection has been dropped by step 4.
      7. $out in the destructor attempts to clean up the temporary system.buckets collection, but it doesn't exist.

      Therefore even though $out errors we leave behind the temporary collection created in step 5 with some documents in it.

      Discovered in SERVER-112061 when we enabled out_primary_stepdown_during_insert.js for viewless. Run out_primary_stepdown_during_insert.js to reproduce this bug.

            Assignee:
            Unassigned
            Reporter:
            Gil Alon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: