Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42373

Prevent "invalid view definition" error while dropping nonexistent collection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.21, 3.6.13, 4.0.10, 4.1.13, 4.2.0-rc4
    • Fix Version/s: 4.2.1, 4.3.1
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0
    • Steps To Reproduce:
      Hide

      The sharding continuous stepdown suite happens to have perfect conditions to reproduce this. However, this should also happen in an unsharded system.

      Simply change this line to if(true) to simulate a scenario where we are trying to drop a collection that has already been dropped.

      Show
      The sharding continuous stepdown suite happens to have perfect conditions to reproduce this. However, this should also happen in an unsharded system. Simply change this line to if(true) to simulate a scenario where we are trying to drop a collection that has already been dropped.
    • Sprint:
      Execution Team 2019-09-23
    • Linked BF Score:
      15

      Description

      In a world where an invalid view exists in the view catalog for a database:

      Concurrent dropCollections for the same namespace will fail due to an invalid view definition. If a collection is successfully dropped the first time, the happy path will not conflict with the view catalog. The second time, since we don't find the collection in the catalog, we assume that we have a view instead. We attempt to look up said view, causing the invalid view definition error even if said view doesn't exist.

      This behavior breaks the invalid system views contract, which is that an invalid view in the view catalog should not interfere with attempting to run operations on unrelated collections.

      It's possible just to make a first pass through the view catalog to verify if a view exists without validating durable views, then to make another pass with validation on if the view does indeed exist.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              haley.connelly Haley Connelly
              Reporter:
              blake.oler Blake Oler
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: