Skip to content

fix(seaweedfs): Enable lifecycle TTL fast path on nodestore and profiles buckets - #4635

Merged
aldy505 merged 1 commit into
getsentry:masterfrom
devops-audeo:fix/seaweedfs-lifecycle-ttl-fastpath
Nov 26, 2026
Merged

aldy505 merged 1 commit into
getsentry:masterfrom
devops-audeo:fix/seaweedfs-lifecycle-ttl-fastpath

Conversation

@devops-audeo

Copy link
Copy Markdown
Contributor

Fixes #4580.

Problem

Since the upgrade to 26.8.0/26.9.0 (SeaweedFS 4.29 → 4.40), new nodestore and profiles objects are written to volumes without TTL, so they never expire and disk usage grows without bound. Volumes created before the upgrade still have Ttl:<retention>.

The lifecycle rules set by install/bootstrap-s3-*.sh are still in place, but SeaweedFS now only stamps the Expiration.Days rule as a volume TTL at PutObject time when the per-bucket lifecycle TTL fast path is enabled, and it is off by default since SeaweedFS 4.32 (seaweedfs/seaweedfs#9825, weed/shell/command_s3_bucket_lifecycle_fastpath.go):

$ echo "s3.bucket.lifecycle.fastpath -name=nodestore" | docker compose exec -T seaweedfs weed shell
Bucket: nodestore
Lifecycle TTL fast path: disabled

Reproduces on upgrades from < 26.8.0, and on fresh installs as well (the fast path is never enabled).

Fix

Right after setlifecycle, enable the fast path on each bucket with an idempotent weed shell call:

echo "s3.bucket.lifecycle.fastpath -name=<bucket> -enable" | $dc exec -T seaweedfs weed shell

It runs in the same block as setlifecycle, so it follows APPLY_AUTOMATIC_CONFIG_UPDATES like the lifecycle policy. The unit tests for both scripts now assert that the fast path reads enabled.

This is the workaround confirmed in the issue thread by several users.

Operator-visible behavior / caveats

  • The TTL is fixed per object at write time: lengthening SENTRY_EVENT_RETENTION_DAYS later doesn't extend objects already written (shortening works for new objects only).
  • Objects already written without TTL since the upgrade are not fixed retroactively. Once no longer written to, those TTL-less volumes can be removed with volume.delete when their last write is older than the retention. Happy to document this separately if useful.
  • On upgraded instances, new writes switch back to a TTL volume layout, so weed mini must have free volume slots for it. One reporter in New nodestore data has no TTL in SeaweedFS since upgrading to 26.9.0 #4580 hit failed to find writable volumes for collection:nodestore until passing an explicit -volume.max (possibly SeaweedFS reaches volume limit after upgrading to 26.8.0, despite free disk space #4503). This PR doesn't change -volume.max.

(Disclosure: this PR was written with AI assistance, Claude Code. I reported #4580 and reviewed the change.)

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

🤖 Generated with Claude Code

…les buckets

SeaweedFS 4.4x stopped stamping the lifecycle expiration as a volume TTL on
new objects unless the per-bucket lifecycle TTL fast path is enabled, which
is off by default. Since the upgrade, new nodestore/profiles objects are
written to TTL-less volumes and never expire.

Enable the fast path right after setlifecycle and assert it in unit tests.

Fixes getsentry#4580

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@aldy505 aldy505 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this!

@aldy505
aldy505 enabled auto-merge (squash) November 26, 2026 13:31
@aldy505
aldy505 merged commit 4f71b86 into getsentry:master Nov 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

New nodestore data has no TTL in SeaweedFS since upgrading to 26.9.0

2 participants