Repository navigation
Cherry pick #131636 to 26.8: Skip a setting value from the server's Hello that this version rejects instead of failing the connection - #132960
Merged
Conversation
Since #131269 a `Seconds` setting rejects a negative or overflowing value, while every supported older release accepts and stores one, and its `TCPHandler::sendHello` sends the user's changed settings in `Hello`. `Connection::receiveHello` read them with the same strict `BaseSettings::read` the server uses for a client's query settings, so a client or an initiator with #131269 could not connect at all to an older server whose user or profile has e.g. `max_execution_time = -1` (`Code: 36 ... cannot be negative`). An unknown non-important setting from the server was already only a warning. `BaseSettings::read` gets an opt-in `skip_invalid_values`: in the `STRINGS_WITH_FLAGS` branch the value string is read first, and if parsing it throws `BAD_ARGUMENTS` or a parse error (`isParseError`, the same classification `insertPostgreSQLValue` uses) for a non-important setting, the field is reset to its default and a warning is logged. The reset is needed because `SettingFieldNonZeroUInt64::parseFromString` assigns before it throws. Any other exception, and an `IMPORTANT` setting (the rule the unknown-setting branch already applies), still fail the read. Only `Connection::receiveHello` opts in: the settings in `Hello` are advisory for the client (the server applies its own profile to every query), while the server's read of a client's settings must keep rejecting `-1` (#131194). Tests: a gtest for the tolerant read (a rejected `Seconds` value, a zero `NonZeroUInt64`, an unparsable `Bool`, a valid setting after them, the strict default, an `IMPORTANT` flag, and an unknown enum name (`load_balancing`), which still fails the tolerant read), and a `test_backward_compatibility` case with a 25.3 node: a user with `max_execution_time = -1`, reached by the tested client and by a tested `remote()` initiator. The test uses `query_and_get_answer_with_error` because the client prints the warning on stderr. Closes #131506 Related #131269, #131194 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…skip-invalid-values Resolve the conflicts with #131099, which removed `SettingsWriteFormat`: `BaseSettings::read` and `Settings::read` now take only `skip_invalid_values`, and the tolerant parse applies to the single remaining string path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lid-values Skip a setting value from the server's Hello that this version rejects instead of failing the connection
Resolve the conflicts of the cherry-pick of #131636. 26.8 still has `SettingsWriteFormat` (master removed it in #131099), so `read` keeps its `format` argument and takes `skip_invalid_values` after it, as in the first commit of #131636 (669fb8d), which was written against this API. The new gtest goes right after `SecondsOnTheWireRejectNegativeAndOverflowingValues`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
The conflicts come from #131099 (it removed
|
Member
|
🕵 Pushed the resolution from the comment above as a fast-forward: |
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.
Original pull-request #131636
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job