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

Check the readSource in dropCollection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
    • Operating System:
      ALL
    • Sprint:
      Storage NYC 2019-01-28
    • Linked BF Score:
      45

      Description

      In BF-9590, we could enter dropCollection() with kMajorityCommitted ReadSource since it's set previously by another command which used the same RecoveryUnit. Then, we read the on-disk index catalog with majorityCommitted timestamp and compare it with the in-memory one. If an index creation was just done after the majority committed point, the in-memory and the on-disk index catalog did not match.

      I think we should assert that DropCollection() is performed with kUnset/kNoTimestamp ReadSource, or at least be aware that DropCollection() can be performed with other ReadSources. It would be useful to prevent bugs that arise from misusing the storage layer that are difficult and racy to diagnose.

      Potential fixes:
      1. Use AutoGetCollectionForRead in dropCollection() to get the collection. AutoGetCollectionForRead has the check for conflicting catalog changes. If the ReadSource is set to a majority timestamp which is less than MinVisibleSnapshotTimestamp, AutoGetCollectionForRead throws an exception and dropCollection() can retry.
      2. Put an invariant "opCtx->RecoveryUnit()->getTimestampReadSource() == kUnset" in dropCollection.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              xiangyu.yao Xiangyu Yao (Inactive)
              Reporter:
              xiangyu.yao Xiangyu Yao (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: