Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions _unit-test/bootstrap-s3-nodestore-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ for i in $(seq 1 5); do
source install/bootstrap-s3-nodestore.sh
done

# Ensure that the lifecycle TTL fast path is enabled, otherwise new objects never expire
fastpath_status=$(echo "s3.bucket.lifecycle.fastpath -name=nodestore" | $dc exec -T seaweedfs weed shell)
if ! echo "$fastpath_status" | grep -q "Lifecycle TTL fast path: enabled"; then
echo "Error: Expected the lifecycle TTL fast path to be enabled on the 'nodestore' bucket"
exit 1
fi

report_success
7 changes: 7 additions & 0 deletions _unit-test/bootstrap-s3-profiles-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ if ! $dc exec seaweedfs s3cmd --access_key=sentry --secret_key=sentry --no-ssl -
exit 1
fi

# Ensure that the lifecycle TTL fast path is enabled, otherwise new objects never expire
fastpath_status=$(echo "s3.bucket.lifecycle.fastpath -name=profiles" | $dc exec -T seaweedfs weed shell)
if ! echo "$fastpath_status" | grep -q "Lifecycle TTL fast path: enabled"; then
echo "Error: Expected the lifecycle TTL fast path to be enabled on the 'profiles' bucket"
exit 1
fi

# Manual cleanup, otherwise `create-docker-volumes.sh` will fail
$dc down -v --remove-orphans

Expand Down
6 changes: 6 additions & 0 deletions install/bootstrap-s3-nodestore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ 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
$s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' getlifecycle s3://nodestore

# SeaweedFS only stamps the lifecycle expiration as a volume TTL on new objects
# when the per-bucket lifecycle TTL fast path is enabled, off by default since
# SeaweedFS 4.32 (seaweedfs/seaweedfs#9825).
echo "Making sure the lifecycle TTL fast path is enabled..."
echo "s3.bucket.lifecycle.fastpath -name=nodestore -enable" | $dc exec -T seaweedfs weed shell
fi

echo "${_endgroup}"
6 changes: 6 additions & 0 deletions install/bootstrap-s3-profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ EOF

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://profiles

# SeaweedFS only stamps the lifecycle expiration as a volume TTL on new objects
# when the per-bucket lifecycle TTL fast path is enabled, off by default since
# SeaweedFS 4.32 (seaweedfs/seaweedfs#9825).
echo "Making sure the lifecycle TTL fast path is enabled..."
echo "s3.bucket.lifecycle.fastpath -name=profiles -enable" | $dc exec -T seaweedfs weed shell
fi
echo "${_endgroup}"
fi
Loading