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

Prevent "invalid view definition" error while dropping nonexistent collection

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.1, 4.3.1
    • Affects Version/s: 3.4.21, 3.6.13, 4.0.10, 4.1.13, 4.2.0-rc4
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • v4.2, v4.0
    • 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.
    • Execution Team 2019-09-23
    • 15

      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.

            Assignee:
            haley.connelly@mongodb.com Haley Connelly
            Reporter:
            blake.oler@mongodb.com Blake Oler
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: