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

Replace classic stage builder index invariants with tassert

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution

      Currently Classic and SBE stage builders differ on the assertion severities when encountering missing index descriptors.

      Classic uses a invariant() which is process fatal:

                  auto descriptor = collectionPtr->getIndexCatalog()->findIndexByName(
                      _opCtx, ixn->index.identifier.catalogName);
                  invariant(descriptor,
                            str::stream() << "Namespace: " << collectionPtr->ns().toStringForErrorMsg()
                                          << ", CanonicalQuery: " << _cq.toStringShortForErrorMsg()
                                          << ", IndexEntry: " << ixn->index.toString()); 

      while SBE uses a tassert() which just kills the operation in non-test environments:

       

          auto desc = collection->getIndexCatalog()->findIndexByName(opCtx, indexName);
          tassert(5432209,
                  str::stream() << "index descriptor not found for index named '" << indexName
                                << "' in collection '" << collection->ns().toStringForErrorMsg() << "'",
                  desc); 

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            catalin.sumanaru@mongodb.com Catalin Sumanaru
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: