Inconsistent handling of non-existent namespaces in explain commands across mongod and mongos

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

      See comments which include the full slack thread for context. In this ticket, we should:

      • Standardize the behavior of explain commands across mongod and mongos to always short-circuit and return EOF-due-to-nonexistent-namespace when the namespace does not exist, rather than erroring.
      • Update our documentation and release notes to inform users of the change and provide guidance for ways to check if a DB or collection does not exist. This will address users relying on error responses to detect non-existent namespaces.
      • Understand which recent-ish changes to sharding have made it so that we can know on a router whether or not a namespace exists. This was not always the case (we used to forward commands against unknown namespaces to the primary shard). What changed?

      Finally, this change presents an opportunity to unify several pieces of code which produce EOF-due-to-nonexistent-namespace output across the code base. As part of this ticket, we should try to unify the "EOF.*ExplainResult” helpers across the cluster command files (and whatever similar explain helpers exist in the regular single-shard files). This will have the additional benefit of standardizing which explain version output we use for these EOF plans (whether the EOF plan is under “winningPlan.queryPlan" or if it’s directly under “winningPlan")

            Assignee:
            Chris Harris
            Reporter:
            Hana Pearlman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: