Add FlushAllPending() to FileStore, fulfilling the IStreamStore interface contract. The method flushes the active MsgBlock to disk and atomically writes a stream.state checkpoint using write-to-temp + rename, matching Go's flushPendingWritesUnlocked / writeFullState pattern. Add FileStoreCrashRecoveryTests with 5 tests covering: - FlushAllPending flushes block data to .blk file - FlushAllPending writes a valid atomic stream.state JSON checkpoint - FlushAllPending is idempotent (second call overwrites with latest state) - Recovery prunes messages backdated past the MaxAgeMs cutoff - Recovery handles a tail-truncated block without throwing Reference: golang/nats-server/server/filestore.go:5783-5842
11 KiB
11 KiB