Files
seaweedfs/weed/filer
Chris LuandClaude Opus 5.5 ff9c9ca007 filer: keep the metadata log a shutdown could not flush and restore it on start (#13470)
* filer: keep the metadata log a shutdown could not flush and restore it on start

When the shutdown flush budget runs out, the events still in the log
buffer were dropped, so a peer or subscriber that had not read them yet
never got them. Keep the unflushed records in the filer store instead,
in parts small enough for stores that cap value size, and put them back
into the log buffer with their original timestamps when the store is
set, before the filer serves. The buffer then flushes them as usual.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filer: keep the unflushed metadata log per address on a shared store

Filers sharing one store would overwrite and replay each other's kept
log under one key. Once a peer has been seen on this filer's store, key
the kept log by the filer's address; a store of its own keeps the
address-free key, so a filer restarting under a new address (a new pod
IP) still finds what it left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filer: drop the restored metadata log copy only once a flush covers it

The kept copy was deleted as soon as its records were back in the log
buffer, so a crash before the next flush lost them again. Keep it until
a flush covers the last restored entry, and let the next shutdown's
kept log replace it, since that shutdown's flushes and kept tail then
hold every restored record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* filer: do not count the subscription to itself as a peer on the store

Every filer follows its own log, and that subscription always reports
the filer's own store, so every store looked shared and the kept log
was keyed by address even on an embedded store, where a new pod IP
then missed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 11:19:09 -08:00
..
…