Skip to content

fix: track blob refcounts so prune does not delete shared files - #68

Open
softmanmaker wants to merge 1 commit into
zly2006:stonecutterfrom
softmanmaker:fix/prune-shared-hash-blobs
Open

fix: track blob refcounts so prune does not delete shared files#68
softmanmaker wants to merge 1 commit into
zly2006:stonecutterfrom
softmanmaker:fix/prune-shared-hash-blobs

Conversation

@softmanmaker

Copy link
Copy Markdown

Summary

  • Persist per-hash blob reference counts (blob_refs) so deleting one backup no longer removes blobs still used by other backups (including empty poi/entities .mca files that share MD5 d41d8cd98f00b204e9800998ecf8427e).
  • On first startup without the table, backfill counts from existing junctions; if the table already exists, trust it. Empty files are never counted and are never deleted; restore recreates a missing empty blob.
  • Add unit tests for backfill, trusted counts, empty MCA prune, rename/shared hash, restore heal, and deleteUnusedBlobs.

Test plan

  • ./gradlew :common:test --tests IncrementalPruneReproduceTest
  • Upgrade an existing world: confirm blob_refs is created once and later restarts do not rescan
  • /xb prune on a world with many empty poi/entities region files; remaining backups still check / restore
  • Restore a backup whose empty blob was already missing; target empty files are created

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant