Skip to content

content store: overlapping deletion aborts filesystem listing and delays orphan cleanup #337

Closed

Description

@allisonmahmood

Problem

On the filesystem backend, an ordinary physical object deletion between directory enumeration and stat aborts the whole list as StoreUnavailable. Orphan cleanup then skips unrelated reclaimable objects until a later pass. No corruption or permanent leak was observed.

Reproduction and controls

Use aged synthetic objects in two patch namespaces. Start real FilesystemContentStore listing through OrphanSweep. After an entry is enumerated but before its stat, let a competing ordinary physical cleanup remove it.

The independent review completed the competing patch's real list/delete sequence, rather than deleting an arbitrary unrelated fixture path:

overlap: filesDeleted=0, failed=1; other patch's 3 aged objects remain
no overlap: 6 objects removed
delete before listing: remaining 3 objects removed
retry after overlap: all remaining 3 removed

Actual filesystem I/O, ContentStore, OrphanSweep and disposable PGlite inventory were used. A tap scheduled the interleaving; it did not fake filesystem results. This is not a full server/DeletionSweep platform-purge test, and operational frequency was not measured. Azure is not affected by this filesystem-specific observation. Foreground index-only files.delete alone is not the trigger.

Cause and smallest change

FilesystemContentStore.walk retains a Dirent whose object has been removed, then converts stat ENOENT into failure of the entire listing stream. OrphanSweep cannot complete that pass.

Skip a now-missing object only when the per-entry stat returns ENOENT. Preserve permission/I/O errors as failures and keep lazy iteration. Listing need not be snapshot-consistent; it should continue to unrelated objects that still exist. Priority is low because a later uninterrupted sweep succeeds.

Audited at ef3e790. Found and independently checked by separate GPT-6 Astra agents in Oh My Pi, using only ordinary offline workflows and synthetic data.

Activity

  1. added
    bug
    needs-triage
    area:server
    on Sep 20, 2026
  2. added a commit that references this issue on Sep 24, 2026
    db3cbc6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:serverbugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions