Skip to content

fix(storage): validate named S3 backend names & remove lock-across-await#3

Closed
papaharry wants to merge 1 commit into
mainfrom
fix/s3-named-scheme-and-client-lock
Closed

fix(storage): validate named S3 backend names & remove lock-across-await#3
papaharry wants to merge 1 commit into
mainfrom
fix/s3-named-scheme-and-client-lock

Conversation

@papaharry

@papaharry papaharry commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Addresses two further Codex review findings on the s3+<name> named-backend feature

Sev Finding Fix
P2 URL-incompatible named names accepted (s3+prod_logs:// fails later in metrics/DataFusion url::Url::parse) Validate named-backend keys in StorageConfigs::validate() — lowercase ASCII alnum + - only. Fails fast at node startup instead of at query time.
P2 Named-client mutex held across create_s3_client().await, serializing all backends behind one slow credential lookup Per-name OnceCell; the (now std) 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 NamedS3StorageConfig from quickwit-config (it's the value type of the public S3StorageConfig.named field).

Tests

  • storage_config::tests::test_validate_named_s3_backend_name
  • storage_config::tests::test_storage_configs_reject_url_incompatible_named_backend
  • s3_compatible_storage_resolver::tests::test_named_backends_cache_independently (ci-test gated, like the other S3 tests)

Local: clippy clean, cargo +nightly fmt --check clean, config tests pass.

…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.
@papaharry papaharry closed this Jun 19, 2026
@papaharry papaharry deleted the fix/s3-named-scheme-and-client-lock branch June 19, 2026 13:22
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.

1 participant