fix(object_store): validate S3 bucket name before use (#20263) - #26585
Open
utkarshmankad wants to merge 1 commit into
Open
fix(object_store): validate S3 bucket name before use (#20263)#26585utkarshmankad wants to merge 1 commit into
utkarshmankad wants to merge 1 commit into
Conversation
An invalid bucket name (e.g. `rw_data`, which contains an underscore) previously only surfaced as an opaque error like "Unexpected (permanent) at stat" on first access, making the real cause hard to diagnose. Add validate_s3_bucket_name() implementing the AWS S3 bucket naming rules, and call it eagerly in build_remote_object_store() for the s3:// scheme (both the native S3ObjectStore and OpenDAL S3 engine paths) so misconfiguration is caught at startup with a clear panic message instead of a confusing runtime error. Closes risingwavelabs#20263
utkarshmankad
force-pushed
the
fix/20263-validate-s3-bucket-name
branch
from
August 4, 2026 21:25
b118982 to
11c0fbe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rw_data, containing an underscore) previously only surfaced as an opaque error likeUnexpected (permanent) at staton first access, which doesn't convey the real reason.validate_s3_bucket_name()insrc/object_store/src/object/s3.rsimplementing the AWS S3 bucket naming rules (length, allowed characters, start/end character, no adjacent periods, no IP-address format, no reserved prefix/suffix).build_remote_object_store()insrc/object_store/src/object/mod.rsfor thes3://scheme, covering both the nativeS3ObjectStoreand OpenDAL S3 engine code paths, so a bad bucket name now panics eagerly at startup with a clear message instead of failing confusingly on first request.Test plan
cargo test -p risingwave_object_store --lib validate_s3_bucket_name— 8/8 passed (valid names, underscore, bad length, uppercase, IP-address format, bad start/end char, adjacent periods, reserved prefix/suffix)cargo test -p risingwave_object_store --lib rejects_invalid_bucket— newtest_build_remote_object_store_rejects_invalid_bucket_nameexercises the actualbuild_remote_object_store()entry point withs3://rw_dataand asserts it panics with"Invalid object store configuration"before any network call — 1/1 passed./risedev d+./risedev psql -c "select 1;"confirms cluster start-up and query path are unaffected by the change (no regression for valid configs)