Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AWS conventions and defaults for configuring object-store metadata access #2796

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pcholakov
Copy link
Contributor

@pcholakov pcholakov commented Feb 27, 2025

This change makes object-store backed metadata more ergonomic and consistent with our snapshots configuration.

cc: @igalshilman if you'd like to chime in!

Changes:

Switch object-store metadata to use utils crate

The config struct for metadata client has switched from an explicit bucket name
to a URL and renamed to "path", consistent with snapshots configuration.

Additionally we now use the shared object store options struct which allows
users to directly set a variety of credentials config keys.

Finally, we switch to using our object-store-utils crate which handles the
client building and AWS credentials caching. This allows us to reuse the AWS
SDK conventions for more ergonomic and consistent configuration.

With this change, we now support simplified server configuration like:

[metadata-client]
type = "object-store"
# bucket = "bucket" # removed in favor of path:
path = "s3://bucket"
aws-profile = "aws-profile"
# aws_region = "eu-central-1"
# aws_access_key_id "..."
# ... and more, from ObjectStoreOptions - same as [worker.snapshots] options

# no longer used; creds can be set within the [metadata-client] section
# [metadata-client.credentials]
# type = "aws-env"

Note thought that thanks to the AWS SDK config resolution mechanism, creds are entirely optional. We will use AWS_PROFILE, AWS_REGION, etc. or server environment STS credentials without any additional configuration.

Note too, that this breaks compatibility. Since we've never documented or advertised this feature, I feel justified in changing the config keys without maintaining backcompat - let me know if you disagree.

Add support for bucket prefixes

This allows users to use a single bucket for multiple use cases, e.g. metadata and snapshots for the same cluster.

We can now do this - note the metadata-0 prefix supplied as part of the object store path:

[metadata-client]
type = "object-store"
path = "s3://restate-snapshots-afs1/metadata-0"

Example:

❯ aws s3 ls s3://restate-snapshots-afs1/
                           PRE metadata-0/
                           PRE metadata-1/

❯ aws s3 ls s3://restate-snapshots-afs1/metadata-0/
2025-02-27 08:45:48       1619 bifrost_config
2025-02-27 08:45:46        478 nodes_config
2025-02-27 08:45:48       2169 partition_table
2025-02-27 08:45:48        122 pp_epoch_0
2025-02-27 08:45:48        122 pp_epoch_1

Closes: #2795

The config struct for metadata client has switched from an explicit bucket name
to a URL and renamed to "path", consistent with snapshots configuration.

Additionally we now use the shared object store options struct which allows
users to directly set a variety of credentials config keys.

Finally, we switch to using our object-store-utils crate which handles the
client building and AWS credentials caching. This allows us to reuse the AWS
SDK conventions for more ergonomic and consistent configuration.
This allows users to use a single bucket for multiple use cases, e.g. metadata and snapshots for the same cluster.
Copy link

github-actions bot commented Feb 27, 2025

Test Results

  7 files  ±0    7 suites  ±0   2m 35s ⏱️ -46s
 47 tests +2   46 ✅ +2  1 💤 ±0  0 ❌ ±0 
182 runs  +8  179 ✅ +8  3 💤 ±0  0 ❌ ±0 

Results for commit da4822e. ± Comparison against base commit 622f4b0.

♻️ This comment has been updated with latest results.


let store = builder
.with_bucket_name(bucket)
.with_conditional_put(ETagMatch)
Copy link
Contributor

Choose a reason for hiding this comment

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

@pcholakov this is important

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's still happening:

let builder = builder
.with_url(destination)
.with_conditional_put(S3ConditionalPut::ETagMatch)
:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make object-store metadata backend configuration consistent with snapshots
2 participants