Files
seaweedFS/weed/mount
Chris Lu 4c36cd04d6 mount: add periodic metadata sync to protect chunks from orphan cleanup (#7700)
mount: add periodic metadata flush to protect chunks from orphan cleanup

When a file is opened via FUSE mount and written for a long time without
being closed, chunks are uploaded to volume servers but the file metadata
(containing chunk references) is only saved to the filer on file close.

If volume.fsck runs during this window, it may identify these chunks as
orphans (not referenced in filer metadata) and purge them, causing data loss.

This commit adds a background task that periodically flushes file metadata
for open files to the filer, ensuring chunk references are visible to
volume.fsck even before files are closed.

New option:
  -metadataFlushSeconds (default: 120)
    Interval in seconds for flushing dirty file metadata to filer.
    Set to 0 to disable.

Fixes: https://github.com/seaweedfs/seaweedfs/issues/7649
2025-12-10 12:45:04 -08:00
..
2025-03-31 21:25:51 -07:00
2022-02-14 03:14:05 -08:00
2025-03-19 21:01:47 -07:00
2024-07-24 23:46:40 -07:00
2022-08-26 17:04:11 -07:00
2024-11-07 13:00:12 -08:00
2022-02-12 01:54:16 -08:00
2022-02-12 01:54:16 -08:00
2024-09-12 22:45:30 -07:00