Skip to content

[Backport release-1.7] fix(seaweedfs): build SeaweedFS in-tree with a bounded S3 read-ahead - #5028

Merged
myasnikovdaniil merged 5 commits into
release-1.7from
backport-4819-to-release-1.7
Oct 21, 2026
Merged

myasnikovdaniil merged 5 commits into
release-1.7from
backport-4819-to-release-1.7

Conversation

@myasnikovdaniil

Copy link
Copy Markdown
Contributor

Backport of #4819 to release-1.7. The five commits are cherry-picked in order from 1913104, d2c6b85, 5592a3f, ecdc043 and e8635f6.

One conflict, in .github/renovate.json: the rule #4819 adds sits next to two e2e sandbox rules from #4867, which is not on this branch. I kept this branch's rules and added only the seaweedfs rule. The diff is the same nine files, +281/-2, as #4819.

The bug is the same here. This branch runs the upstream chrislusf/seaweedfs:4.45 image, and its S3 gateway is OOM-killed while serving a large object (#3782).

This needs to land before rc.2 is cut, otherwise rc.2 and v1.7.0 ship the upstream image.

The S3 gateway is OOM-killed while serving a large object. SeaweedFS
starts read-ahead downloads after every read of a sequential stream and
counts only the downloads it newly starts toward its prefetch window,
so a GET reading 256 KiB at a time out of 4 MiB chunks pulls up to
about a gigabyte of the object into memory, past the 512Mi limit of
the S3 deployment. No SeaweedFS release carries a fix yet, so there is
no release to move to instead.

Build weed from the 4.45 sources with a patch that keeps the window at
the next prefetchCount chunks, and lay it over the upstream image of
the same tag so the rest of the image stays upstream's own. The image
build runs the tests of the packages the patch touches, including the
regression test the patch adds, because go build never compiles them.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <[email protected]>
(cherry picked from commit 1913104)
Signed-off-by: Myasnikov Daniil <[email protected]>
With the image keys unset the vendored chart renders chrislusf/seaweedfs
at its appVersion, so the patched build from images/seaweedfs would be
built and never run, and the S3 gateway would keep being OOM-killed on
large GETs. Point every component at the in-tree image, pinned by
digest like every first-party reference, and hold that in a unit test
so a values change cannot quietly fall back to the upstream binary.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <[email protected]>
(cherry picked from commit d2c6b85)
Signed-off-by: Myasnikov Daniil <[email protected]>
The in-tree build pinned its source, base image and toolchain by hand,
and nothing moved them when `make update` vendored a new chart, so a
bump would build one release's weed into another release's image, or
keep patching a release that already carries the fix.

Pin the source archive by checksum and the upstream image by digest as
build arguments, compile with the toolchain upstream's own builder uses
for the tag, and let `make update` re-pin all of them from the vendored
chart and fail when the patches no longer apply. The tests of the
patched packages now run once rather than once per target platform,
and `weed version` names the build.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <[email protected]>
(cherry picked from commit 5592a3f)
Signed-off-by: Myasnikov Daniil <[email protected]>
Renovate would bump the builder, the base image or their digests one at
a time into a combination upstream never shipped, and the next `make
update` would silently put them back, so it leaves that Dockerfile to
the update recipe. The patches are unified diffs of Go sources, whose
context lines start with a marker before tabs and blank lines, which
git's whitespace checks would otherwise flag or rewrite.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <[email protected]>
(cherry picked from commit ecdc043)
Signed-off-by: Myasnikov Daniil <[email protected]>
The builder, the compile flags and the version stamp changed, so the
image built from them has a new digest, and values.yaml has to name it
for the components to run that build.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <[email protected]>
(cherry picked from commit e8635f6)
Signed-off-by: Myasnikov Daniil <[email protected]>
@github-actions github-actions Bot added area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug labels Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab3dc611-9a42-472a-9755-41e5c39078af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size/L This PR changes 100-499 lines, ignoring generated files label Oct 21, 2026
@myasnikovdaniil
myasnikovdaniil merged commit efbcce2 into release-1.7 Oct 21, 2026
56 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport-4819-to-release-1.7 branch October 21, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants