Skip to content

Rename config setting + Disable compression by default#34

Merged
m-szymon merged 2 commits into
scylladb:masterfrom
wkkasztan:master
Jun 11, 2026
Merged

Rename config setting + Disable compression by default#34
m-szymon merged 2 commits into
scylladb:masterfrom
wkkasztan:master

Conversation

@wkkasztan

Copy link
Copy Markdown
Contributor

Client should disable request compression by default, as older Scylla versions do not support request compression.

Also, enforce_header_whitelist config setting can be simplified to strip_headers.

@wkkasztan wkkasztan mentioned this pull request May 27, 2026
@wkkasztan wkkasztan marked this pull request as ready for review May 27, 2026 11:49
@wprzytula wprzytula requested review from Copilot and m-szymon May 27, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread src/client.rs Outdated
Comment thread src/interceptors.rs Outdated
Comment thread src/strip_headers.rs Outdated
///
/// Removes unwanted headers from the given request
pub(crate) fn strip_headers(request: &mut Request) {
pub(crate) fn strip_request_from_headers(request: &mut Request) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔧 The order is wrong. See the examples I found:

Example: "I need to strip the old paint from the cabinet."
Example: "The wind stripped the leaves from the trees."

@wkkasztan wkkasztan force-pushed the master branch 2 times, most recently from f64fdfd to 38a9a2b Compare May 27, 2026 14:14
Comment thread src/interceptors.rs Outdated

@m-szymon m-szymon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Following other drivers we should call it optimize_headers (and headers_whitelist when we can customize the whitelist).

Comment thread src/config.rs
Comment on lines -60 to -61
pub fn enforce_header_whitelist(&self) -> Option<bool> {
self.alternator_ext.enforce_header_whitelist

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should be consistent with other drivers:

Driver Option name Custom whitelist
Java withOptimizeHeaders(true) withHeadersWhitelist(List)
Python optimize_headers=True headers_whitelist=frozenset
Go WithOptimizeHeaders(true) N/A

@m-szymon

m-szymon commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Please, resolve conflicts.

lukaszg22 added a commit to lukaszg22/alternator-rust-driver that referenced this pull request Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Comment thread src/config.rs
}

/// Before sending each request, strip them from headers that are not used by the Alternator.
/// Before sending each request, strip the headers from them which are not used by the Alternator.
Comment thread src/config.rs
}

/// Before sending each request, strip them from headers that are not used by the Alternator.
/// Before sending each request, strip the headers from them which are not used by the Alternator.
Comment thread src/config.rs
}

/// Before sending each request, strip them from headers that are not used by the Alternator.
/// Before sending each request, strip the headers from them which are not used by the Alternator.
Comment thread src/config.rs
Comment on lines +68 to 70
pub fn optimize_headers(&self) -> Option<bool> {
self.alternator_ext.optimize_headers
}
Comment thread src/client.rs
/// - chooses an arbitrary aws region, as alternator doesn't require one
/// - does not use request compression
///
/// Can be build using [AlternatorConfig] like so:

@m-szymon m-szymon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please take a look at correctness of comments.

E.g. the module-level comment at the top (tests/http_content/optimize_headers.rs:1-33) still has several grammar/style issues, for example:

  • follow specific header whitelist
  • therefore we in fact, need to strip them
  • first 3 use the same set of driver calls

Comment thread src/client.rs
/// By default:
/// - enables round-robin load balancing
/// - strips headers that are not used by the alternator from all requests
/// - chooses an arbitrary aws region, as alternator doesn't require one

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This wording is a bit misleading. The client does not choose an arbitrary region; it sets a concrete default region. I would phrase this as "sets a default AWS region" instead.

@m-szymon m-szymon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am merging as is. Remaining nitpicks need to be improved in follow-ups: #39

@m-szymon m-szymon dismissed wprzytula’s stale review June 11, 2026 08:48

Direct comments were addressed.

@m-szymon m-szymon merged commit 16e92eb into scylladb:master Jun 11, 2026
2 checks passed
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.

4 participants