diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-09 19:03:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-09 19:03:15 -0800 |
| commit | 1b13324fb79a8dcbc00044b90c357c41c2cc70c7 (patch) | |
| tree | 0270ea29eb43d014cdc31c43fc868f542194094b /weed/filer/stream.go | |
| parent | 4f382b77c898b9685e16a49048681bb73d07ee54 (diff) | |
| download | seaweedfs-1b13324fb79a8dcbc00044b90c357c41c2cc70c7.tar.xz seaweedfs-1b13324fb79a8dcbc00044b90c357c41c2cc70c7.zip | |
fix: skip log files with deleted volumes in filer backup (#7692)
fix: skip log files with deleted volumes in filer backup (#3720)
When filer.backup or filer.meta.backup resumes after being stopped, it may
encounter persisted log files stored on volumes that have since been deleted
(via volume.deleteEmpty -force). Previously, this caused the backup to get
stuck in an infinite retry loop with 'volume X not found' errors.
This fix catches 'volume not found' errors when reading log files and skips
the problematic file instead of failing. The backup will now:
- Log a warning about the missing volume
- Skip the problematic log file
- Continue with the next log file, allowing progress
The VolumeNotFoundPattern regex was already defined but never used - this
change puts it to use.
Fixes #3720
Diffstat (limited to 'weed/filer/stream.go')
| -rw-r--r-- | weed/filer/stream.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/weed/filer/stream.go b/weed/filer/stream.go index b2ee00555..00539ca20 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -245,6 +245,7 @@ type ChunkStreamReader struct { var _ = io.ReadSeeker(&ChunkStreamReader{}) var _ = io.ReaderAt(&ChunkStreamReader{}) +var _ = io.Closer(&ChunkStreamReader{}) func doNewChunkStreamReader(ctx context.Context, lookupFileIdFn wdclient.LookupFileIdFunctionType, chunks []*filer_pb.FileChunk) *ChunkStreamReader { @@ -403,8 +404,13 @@ func (c *ChunkStreamReader) fetchChunkToBuffer(chunkView *ChunkView) error { return nil } -func (c *ChunkStreamReader) Close() { - // TODO try to release and reuse buffer +func (c *ChunkStreamReader) Close() error { + c.bufferLock.Lock() + defer c.bufferLock.Unlock() + c.buffer = nil + c.head = nil + c.chunkView = nil + return nil } func VolumeId(fileId string) string { |
