TT Lab
Blog

한국어 English 日本語 中文

Get started
Blog

Blog

Resurrecting Flags and Seemingly Empty Buckets: The Story of How a SeaweedFS weed mini Help PR Led to a Behavior Change

Result: Merged (2026-10-16, seaweedfs/seaweedfs#11755). This was actually taken from GitHub PR and review originals, the SeaweedFS source (the PR's base commit 590a75b9), and TT Lab repository's commit and documentation records. Times are in Korea Standard Time (KST). As of 2026-10-17, no release includes this change yet (latest release 4.48, 2026-09-28).

Table of Contents

One-line Summary

PR seaweedfs/seaweedfs#11755 mini: note mini.options and Docker filer.toml pitfalls in help
Changes weed mini -h 11 lines of Notes at the end of help. Code behavior unchanged
Reaction Three review bots reviewed within 9 minutes, pointing out three issues. The maintainer opened a PR fixing the behavior #11758 and merged it first
Result The maintainer added a Notes modification commit to our branch and merged it as a single commit (our account as author, maintainer as co-author)
Time Taken PR published 2026-10-15 08:15 → Merged 2026-10-16 10:44, about 26.5 hours
기여 한 건의 흐름 — SeaweedFS #11755 의 경우 왼쪽은 매번 같은 단계, 오른쪽은 이번에 있었던 일(한국 시간) 1 운영 중 발견 플래그를 지워도 값이 되살아남(09-19) 복원한 사본의 버킷이 비어 보임(09-24) 2 실측·소스 확인 로컬에서 재현, mini.go 의 저장·적용 함수와 이미지의 filer.toml 을 읽음 3 패치 weed mini -h 에 Notes 11줄 동작은 바꾸지 않음, DCO 서명 4 PR 10-15 08:15 공개, 템플릿의 AI 체크 항목과 고지 문장을 채움 5 봇·리뷰 봇 셋이 9분 안에 지적 셋(포트 예외 등) 메인테이너가 #11758 로 동작을 고침 6 머지 10-16 10:44, Notes 를 새 동작에 맞춰 한 커밋으로(공동 저자 표기) 5번에서 우리가 답하기 전에 메인테이너가 먼저 움직였다
Figure: Flow of a single contribution and what happened in #11755

1. What Was the Problem: Symptoms We Experienced

weed mini is a mode that runs SeaweedFS's master, volume server, filer, and S3 gateway as a single process. The TT Lab cluster uses this in two places: as a community/blog media storage, and as a production DB backup storage. The backup storage was originally MinIO, but we migrated to SeaweedFS in September 2026 when MinIO ended binary and image distributions.

Trap One: Deleted Flags Resurrect (2026-09-19)

Volume expansion stopped in the media storage, and the cause was the master's raft state carrying over across repeated restarts. Since it is a single master with no state to preserve, we attached -master.resumeState=false to make it start fresh every time.

However, when testing locally, even if we deleted this line from the command line and started it again, it still booted up with false . This was because mini wrote command-line flags to a file in the data directory and read them back on the next startup. We left a comment in the manifest saying, "Do not delete the line when rolling back." mini.options Nowhere did it mention this file. weed mini -h Nowhere did it mention this file.

Trap Two: Restored Copy's Buckets Appear Empty (2026-09-24)

A backup is only a backup if you can restore it. We tested restoration by copying the backup storage's data directory to a NAS and spinning up mini with the same image. When we attached the copy to a different path in the container and supplied -dir as that path, only two buckets were visible and zero objects existed. There were no errors. When we attached the copy to /data , all 10,004 objects migrated from MinIO were read with their keys, sizes, and SHA-256 hashes intact, exactly as they were when copied.

Both times, the issue was not "we configured something wrong" but "there were rules the tool didn't tell us." The next person is bound to walk into the exact same traps.

2. Cause: Which Lines in the Source?

All line numbers below are based on the PR's base commit 590a75b9 . TT Lab's used version 4.29 also had the same function contents (opened tag 4.29's mini.go to compare).

weed mini 의 두 함정 ① mini.options — #11758 이전 기동 1 -master.resumeState=false mini.options 에 기록 resumeState=false 기동 2: 줄을 지움 값 true = 기본값 저장된 false 를 다시 적용 오류도 안내도 없음 기준은 「명령줄에 줬나」가 아니라 「지금 값이 기본값인가」 ② #11758 이후 명령줄 플래그는 저장하지 않고, 늘 저장값을 이긴다 계산한 값(볼륨 상한)만 고정, 적용하면 기동 때 한 줄 출력 ③ 공식 이미지의 filer.toml -dir=/restore 사본을 붙인 곳 볼륨 파일 사본에 그대로 있음 /etc/seaweedfs/filer.toml dir = /data/filerldb2 파일러 메타데이터 /data 의 빈 새 저장소 버킷은 보이는데 객체는 0개, 오류 없음
Figure: The two traps of weed mini and how they look after #11758

mini.options: Not "Did you pass it on the command line?" but "Is it equal to the default?"

Therefore, if you give -master.resumeState=false once, it gets saved to the file, and upon starting after deleting the line, since the value is the default true , the file's false is reapplied. Even if you explicitly specify =true on the command line, it is the same as the default, so the result is the same—with the exception of port flags. The comment we left in the manifest, "Do not delete the line, change it to ", is also advice that won't work according to the source (this is based on reading the source, not actual measurement). Furthermore, since mini suppresses default logs, the message that "saved options were applied" ( =true ) is not visible in the default settings.V(2)).

filer.toml: The image fixes the metadata location

As a result, volume files go to -dir , and filer metadata goes to /data/filerldb2 . If you move -dir elsewhere and leave only that location, the metadata disappears along with the container. The reason both buckets were visible in our restoration test is likely because the startup flag -bucket newly created the buckets on top of the empty metadata (an interpretation based on the source's bucket creation code and the flags in our manifest).

3. What was changed: Summary of diff

Without touching the code, we added Notes to the end of the help text for cmdMini of Long . This is the gist of the first submitted version.

+Notes:
+- Flags are saved to <dir>/mini.options and applied again on the next
+  start to every flag that is not given on the command line. Removing a
+  flag, or passing it with its default value, does not restore the
+  default on the next start. Edit or delete mini.options instead.
+- The official Docker image ships /etc/seaweedfs/filer.toml, which keeps
+  the filer metadata in /data/filerldb2 regardless of -dir. If you set
+  -dir to another path, keep /data on a persistent volume as well.
+  ...

There are two reasons we only fixed the documentation. Changing the behavior is a design decision for the maintainer to make, and an external contributor's first PR needs to be small and easy to review to have a good chance of being accepted. SeaweedFS's PR template includes a checkbox stating, "Any AI-generated PR has been reviewed line by line and kept to a minimum." We checked both boxes and added a sentence at the end of the body stating that we wrote it with AI assistance and reviewed it ourselves. We added a DCO signature (Signed-off-by) and an SSH signature to the commit. We stated directly in the body that testing consisted solely of comparing gofmt and the above functions in the source code.

4. How the Bot and Maintainer Responded

Three Bots Arrived in 9 Minutes

Right after opening the PR (10-15 08:16–08:24), three review bots—Devin, CodeRabbit, and Greptile—attached themselves. There were three public points raised, all of which were related to the first Note.

Looking back at the source code in Section 2, the bots were right. Our phrasing was correct for general flags, but wrong for the eight port flags. Even after reading the list of exceptions (portFlagNames), we failed to include them in the text.

The Maintainer Acted Before We Responded

To be honest, we neither replied nor made fixes in response to these points for a full day. In the meantime (10-15 23:15), the maintainer referenced our PR and opened #11758 . The problem definition was precisely the two traps our PR had noted, and the solution was a change in behavior, not just the documentation.

, a warning is issued at startup (-dir #11758 was merged at 10-16 10:36, and three minutes later, the maintainer pushed a commit to our branch updating the Notes to match the new behavior. The first Note was updated to "Command-line flags are never saved and always override saved values; only calculated values are saved," and "Warn at startup if outside

" was added to the second Note. In a comment, they summarized that thanks to this change, the bot's feedback regarding default comparisons and port exceptions was no longer applicable.

The Bot's Second Feedback and Sequence Explanation-dir Greptile left two new comments on the new commit: "The source code contains code that saves command-line flags," and "There is no code checking outside

." The bot was looking at code prior to #11758. To each inline comment, the maintainer replied, "This PR comes after #11758, which removes saving and adds the check," and the bot retracted both points in under a minute. Then it was merged at 10:44. Co-authored-by The merge was a squash combining the two commits, with our account listed as the commit author and the maintainer as

. Out of the 13 lines of final documentation, the text we originally wrote that remained intact was mostly the second Note, while the first Note was rewritten by the maintainer to fit the new behavior.

Titi's word. I put up a sign in the help section saying "There is a hole here!", and the administrator came and plugged the hole! But they left the sign. When the bot says "The text on the sign is a bit wrong," we decided to rewrite it on the same day rather than the next day.

Links

All materials were accessed on 2026-10-17.

Sign in to like

Comments

No comments yet.

Sign in to leave a comment