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

Disallow using the "system.views" collection name as the source or target names in the rename command

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Sprint:
      Execution Team 2019-08-26, Execution Team 2019-09-09
    • Linked BF Score:
      5

      Description

      This is a bug fix for a build failure where the following scenario leads to a deadlock:

      T1: Rename command is renaming 'test.coll' to 'test.system.views', so it has the MODE_IX on 'test' and MODE_X on both 'coll' and 'system.views'. The next step is to check if 'coll' is a view by calling the ViewCatalog::lookup() and waiting to acquire the ViewCatalog mutex which is currently held by T2.

      T2: Running CountCmd on a collection that didn't exist, but in AutoGetCollection we check if it could be a view and call ViewCatalog::lookup(), here we see that the ViewCatalog is invalidated, so we call _reloadIfNeeded. Now _reloadIfNeeded() uses the DurableViewCatalog::iterate but that requires the MODE_IS lock on the 'test.system.views' collection which is currently held by T1.

      So we have a deadlock where:
      T1 has MODE_X on 'test.system.views' but is waiting for ViewCatalog mutex.
      T2 has ViewCatalog mutex during reload and needs MODE_IS on 'test.system.views'.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              xiangyu.yao Xiangyu Yao (Inactive)
              Reporter:
              gregory.wlodarek Gregory Wlodarek
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: