count command stores namespace translated from UUID at authorization layer and leads to incorrect results across rename

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • 2
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      Some commands accept a UUID as input instead of the namespace. One of those being count. These commands perform a UUID --> Namespace translation at the authorization layer / command instantiation. This is performed consulting the catalog at a point where there is no storage snapshot to establish a consistent catalog for. Thus the translation is done at latest.

      The issue for count specifically is that this translated namespace is stored and used during command execution. The provided UUID might have been renamed after the authz check, and by the time the command execution opens a snapshot and establishes a consistent catalog. This leads to executing count against the old namespace in a snapshot where the UUID corresponds to a new name, and incorrectly returning a count of 0 (or less likely other values if the old namespace was reused in that window).

      Another consequence is that when interleaved with drop, instead of returning NamespaceNotFound as is the usual for non-existing UUIDs, count will return n=0. Or less likely, if the old namespace was reused with a different UUID, incorrect results.

            Assignee:
            Unassigned
            Reporter:
            Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: