filer.backup mirror retains .upload staging files — ~2x storage footprint #1

Open
opened 2026-09-30 22:48:39 +00:00 by litelotus · 0 comments
Owner

Problem

Every mirrored file is accompanied by a duplicate <name>.upload staging file, roughly doubling the footprint on the Storage Box share.

Measured 2026-09-30, ~25 min into the first run:

mirror files: 557
.upload:      278   (~50%)
size:         15.6G

Each pair is byte-identical in size:

-rwxrwxrwx 41303610 ... 41 - Revenge ...[2585038].cbz
-rwxrwxrwx 41303610 ... 41 - Revenge ...[2585038].cbz.upload

On a share sized at 2.5 TiB this halves effective capacity.

What it is not

  • Not the sink's temp file. weed/replication/sink/localsink/local_sink.go writes via os.CreateTemp(dir, ".seaweedfs-tmp-*") and then os.Renames it into place. It never emits .upload.
  • Not mirrored source litter. fs.ls /buckets/pvc-b2259b42-2ed4-45df-b66f-784b00784fd3/ reports 3093 entries and zero matching *.upload.

So the source creates <name>.upload transiently (upload/import staging), the mirror copies it on the create event, and the later rename to the final name does not produce a delete the sink acts on — leaving the staging copy behind permanently. The 1:1 ratio for every file (not a scattered few) is consistent with a bulk import where each file was written the same way.

Suggested fix

weed filer.backup has -filerExcludeFileNames (comma-separated wildcards) for exactly this:

-filerExcludeFileNames='*.upload'

Add it to each run ... line in the filer-backup sidecar script (seaweed/main.go), alongside the existing -filerPath / -retentionDays.

Cleanup

Exclusion only stops new ones — the already-mirrored .upload files need a one-off removal, or the share stays at 2x until retention catches up.

Verify

./verify-filer-backup.sh

Step 3 prints the current .upload count and flags it.

## Problem Every mirrored file is accompanied by a duplicate `<name>.upload` staging file, roughly **doubling** the footprint on the Storage Box share. Measured 2026-09-30, ~25 min into the first run: ``` mirror files: 557 .upload: 278 (~50%) size: 15.6G ``` Each pair is byte-identical in size: ``` -rwxrwxrwx 41303610 ... 41 - Revenge ...[2585038].cbz -rwxrwxrwx 41303610 ... 41 - Revenge ...[2585038].cbz.upload ``` On a share sized at 2.5 TiB this halves effective capacity. ## What it is not - **Not the sink's temp file.** `weed/replication/sink/localsink/local_sink.go` writes via `os.CreateTemp(dir, ".seaweedfs-tmp-*")` and then `os.Rename`s it into place. It never emits `.upload`. - **Not mirrored source litter.** `fs.ls /buckets/pvc-b2259b42-2ed4-45df-b66f-784b00784fd3/` reports 3093 entries and **zero** matching `*.upload`. So the source creates `<name>.upload` transiently (upload/import staging), the mirror copies it on the create event, and the later rename to the final name does not produce a delete the sink acts on — leaving the staging copy behind permanently. The 1:1 ratio for every file (not a scattered few) is consistent with a bulk import where each file was written the same way. ## Suggested fix `weed filer.backup` has `-filerExcludeFileNames` (comma-separated wildcards) for exactly this: ``` -filerExcludeFileNames='*.upload' ``` Add it to each `run ...` line in the filer-backup sidecar script (`seaweed/main.go`), alongside the existing `-filerPath` / `-retentionDays`. ## Cleanup Exclusion only stops new ones — the already-mirrored `.upload` files need a one-off removal, or the share stays at 2x until retention catches up. ## Verify ``` ./verify-filer-backup.sh ``` Step 3 prints the current `.upload` count and flags it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
homelab/seaweed#1
No description provided.