Skip to content

Act on listed identities in expansion, lookups, invalidation and rm/chmod/cat/du (#1381 step 2) #1402

Closed

Description

@laughingman7743

Part of #1381 (step 2 of 4). Builds on step 1 (#1401).

Current state (758adee)

Take the literal keys a/x and a/x?versionId=null in an unversioned bucket:

  • chmod("bucket/a", "private", recursive=True) sends PutObjectAcl to a/x twice, once with VersionId=null. It never updates the literal key.
  • rm("bucket/a", recursive=True) deletes a/x and a/x version null, and leaves the literal key.
  • cat("bucket/a", recursive=True) reads a/x version null for the literal key, on both filesystems.
  • du("bucket/a") looks up a/x twice and never looks up the literal key.

Lookups and invalidation make the same mistake:

  • HeadObject results for an explicit version are cached under the string bucket/key?versionId=v. A key that ends in that literal text would be cached under the same string. _ls_from_cache reads that string key before it checks for a version.
  • _invalidate_path splits a version off any path that ends in a version query. After the key a/dir?versionId=v1/z is deleted, the listing of its directory a/dir?versionId=v1 stays cached.

Scope

  1. A private typed expansion that the sync and async filesystems share:
    • It takes the identities of the glob and find entries.
    • A recursive glob keeps its identities.
    • A path that the user passes is parsed once.
    • expand_path() returns the same strings.
  2. Lookups use cache keys that cannot collide.
    • A version lookup is cached under a key that no plain path string can take, together with its parameterized lookups and its eviction.
    • info, exists, _head_object and _ls_from_cache choose the cache key from the typed address. An explicit version never uses a current-version listing.
    • Unchanged:
      • An unversioned lookup stays cached under the unversioned address, even when version_aware pins a version.
      • An explicit null version is not cached.
      • Lookups with different authorization parameters stay apart.
  3. Invalidation takes a typed address.
    • Delete batches and the file writers, sync and async, pass the address they know.
    • invalidate_cache(str) keeps its public behavior, including both raw and slash-stripped spellings.
  4. The fan-outs rm, chmod, cat and du act on typed paths, on both filesystems.
    • du keeps one lookup per entry. Summing listing sizes is a separate optimization, because a synthetic directory can replace an object of the same name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions