Skip to content

Changing RETENTION_DAYS with nodestore #4028

@kodebach

Description

@kodebach

Self-Hosted Version

25.10.0

CPU Architecture

x86_64

Docker Version

28.3.2

Docker Compose Version

28.3.2

Machine Specification

  • My system meets the minimum system requirements of Sentry

Steps to Reproduce

  1. Run ./install.sh
  2. Change SENTRY_EVENT_RETENTION_DAYS in .env
  3. Re-run ./install.sh

Expected Result

The new SENTRY_EVENT_RETENTION_DAYS set in .env is used.

Actual Result

AFAICT with the new seaweedfs container the lifecycle policy is only set during initial setup in install/bootstrap-s3-nodestore.sh

The setup for the lifecycle policy is behind this if

if [[ $(echo "$bucket_list" | tail -1 | awk '{print $3}') != 's3://nodestore' ]]; then
apply_config_changes_nodestore=0
# Only touch if no existing nodestore config is found

and the else branch is just a no-op

# XXX(aldy505): Should we refactor this?
lifecycle_policy=$(
cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>Sentry-Nodestore-Rule</ID>
<Status>Enabled</Status>
<Filter></Filter>
<Expiration>
<Days>$SENTRY_EVENT_RETENTION_DAYS</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>
EOF
)
$dc exec seaweedfs sh -c "printf '%s' '$lifecycle_policy' > /tmp/nodestore-lifecycle-policy.xml"
$s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' setlifecycle /tmp/nodestore-lifecycle-policy.xml s3://nodestore
echo "Making sure the bucket lifecycle policy is all set up correctly..."
$s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' getlifecycle s3://nodestore
else
echo "Node store already exists, skipping..."
fi

This is probably a bit of an edge case, and some additional documentation about changing the retention period might be enough. I just noticed the issue while looking at the script, while manually upgrading to 25.10.0 after skipping the nodestore change for 25.9.0.

Event ID

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions