fix(storage): validate named S3 backend names & remove lock-across-await#3
Closed
papaharry wants to merge 1 commit into
Closed
fix(storage): validate named S3 backend names & remove lock-across-await#3papaharry wants to merge 1 commit into
papaharry wants to merge 1 commit into
Conversation
…wait Two further Codex review findings on the s3+<name> named-backend feature: - config: reject URL-incompatible named-backend names at config load (StorageConfigs::validate). The name is embedded in the `s3+<name>://` URI scheme, which the metrics/DataFusion path parses with `url::Url`; restrict to lowercase ASCII letters, digits, and `-` so routing stays consistent instead of failing at query time. - storage: stop holding the named-client mutex across `create_s3_client`. Each named backend caches behind its own `OnceCell`; the (now std) mutex is held only synchronously to fetch/insert the cell, so independent backends initialize concurrently. Also resolves the GAP-002 tokio-mutex / lock-across-await violation. Exports NamedS3StorageConfig from quickwit-config. Adds tests for name validation and per-backend client caching.
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.
Addresses two further Codex review findings on the
s3+<name>named-backend features3+prod_logs://fails later in metrics/DataFusionurl::Url::parse)StorageConfigs::validate()— lowercase ASCII alnum +-only. Fails fast at node startup instead of at query time.create_s3_client().await, serializing all backends behind one slow credential lookupOnceCell; the (nowstd) mutex is held only synchronously to fetch/insert the cell. Backends initialize concurrently. Also fixes the GAP-002 tokio-mutex / lock-across-await violation.Also exports
NamedS3StorageConfigfromquickwit-config(it's the value type of the publicS3StorageConfig.namedfield).Tests
storage_config::tests::test_validate_named_s3_backend_namestorage_config::tests::test_storage_configs_reject_url_incompatible_named_backends3_compatible_storage_resolver::tests::test_named_backends_cache_independently(ci-test gated, like the other S3 tests)Local: clippy clean,
cargo +nightly fmt --checkclean, config tests pass.