Reject "collectionless" namespaces for all commands that require a real collection

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      "Collectionless" collection names include $cmd.aggregate, $cmd.listCollections, and others. Some commands (like most writes, including createIndexes) already reject these namespaces, while others (like listIndexesdrop) accept the namespace and treat it as a non-existing collection, returning "OK" responses as if they were actually doing meaningful processing.

      It would be convenient if there was a generic way to reject collectionless namespaces for commands that require a real collection. I tried implementing something like this in IDL (see link in comments) but it only looked for "$cmd.aggregate". Maybe that PR could be extended to check for generic "collectionless" namespaces, possibly via CommandHelpers::ensureValidCollectionName() (although that might reject other internal but valid namespaces?). Alternatively, maybe there is another approach that doesn't require IDL changes. 

            Assignee:
            Unassigned
            Reporter:
            Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: