Files
seaweedFS/weed/storage
Chris Lu 7920ffa98c Fix uncleanable size=0 orphans with volume.fsck -forcePurging (#7783)
This is a follow-up fix to PR #7332 which partially addressed the issue.

The problem is that size=0 needles are in a gray area:
- IsValid() returns false for size=0 (because size must be > 0)
- IsDeleted() returns false for size=0 (because size must be < 0 or == TombstoneFileSize)

PR #7332 only fixed 2 places, but several other places still had the same bug:

1. needle_map_memory.go:doLoading - line 43 still used oldSize.IsValid()
2. needle_map_memory.go:DoOffsetLoading - used during vacuum and incremental loading
3. needle_map_leveldb.go:generateLevelDbFile - used when generating LevelDB needle maps
4. needle_map_leveldb.go:DoOffsetLoading - used during incremental loading for LevelDB
5. needle_map/compact_map.go:delete - couldn't delete size=0 entries because:
   - The condition 'size > 0' failed for size=0
   - Even if it passed, negating 0 gives 0 (not marking as deleted)

Changes:
- Changed size.IsValid() to !size.IsDeleted() in doLoading and DoOffsetLoading functions
- Fixed compact_map delete to use TombstoneFileSize for size=0 entries

Fixes #7293
2025-12-15 21:39:27 -08:00
..
2025-06-16 22:25:22 -07:00
2025-10-26 22:50:37 -07:00
2023-03-08 01:48:28 -08:00
2022-11-14 00:19:27 -08:00
2025-06-30 13:57:28 -07:00
2025-06-30 10:11:30 -07:00
2019-04-17 22:04:49 -07:00
2025-06-16 22:05:06 -07:00
2025-11-10 20:30:21 -08:00
2025-06-16 22:25:22 -07:00