Skip to content

Fix negate function monotonicity#71440

Merged
nikitamikhaylov merged 15 commits intomasterfrom
negging
Feb 19, 2025
Merged

Fix negate function monotonicity#71440
nikitamikhaylov merged 15 commits intomasterfrom
negging

Conversation

@al13n321
Copy link
Member

@al13n321 al13n321 commented Nov 5, 2024

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix negate function monotonicity. In previous versions, the query select * from a where -x = -42; where x is the primary key, can return a wrong result.

Fixes this:

create table a (x UInt64) engine MergeTree order by x;
insert into a values (12345678901234567890), (42);
select * from a where -x = -42;

It used to return empty result because KeyCondition took the range [42, 12345678901234567890], asked function negate whether it's monotonic on this range, it (incorrectly) said yes, and KeyCondition applied negate to this range, producing an inverted range [6101065172474983726, -42] (where 6101065172474983726 is what -12345678901234567890 overflows to).

@al13n321 al13n321 mentioned this pull request Nov 5, 2024
30 tasks
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 5, 2024
@robot-clickhouse
Copy link
Member

robot-clickhouse commented Nov 5, 2024

This is an automated comment for commit 83720a8 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
Bugfix validationChecks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (asan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (debug)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (msan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (tsan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (ubsan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns ClickBench with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@evillique evillique self-assigned this Nov 5, 2024
@alexey-milovidov
Copy link
Member

@evillique, please update the test.

@robot-ch-test-poll2 robot-ch-test-poll2 added pr-bugfix Pull request with bugfix, not backported by default and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Dec 3, 2024
@al13n321
Copy link
Member Author

al13n321 commented Dec 4, 2024

The remaining test failures look unrelated.

@al13n321
Copy link
Member Author

al13n321 commented Dec 6, 2024

Fixed one of them: #72870

@al13n321
Copy link
Member Author

I somehow still don't know what's the intended way to deal with flaky tests blocking PRs ~100% of the time. Will keep merging origin/master into every PR every few days until CI passes by chance.

@alexey-milovidov
Copy link
Member

Fix all the tests.

@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Jan 28, 2025

Dear @evillique, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Feb 7, 2025

Workflow [PR], commit [5f762ef]

@nikitamikhaylov nikitamikhaylov added this pull request to the merge queue Feb 19, 2025
Merged via the queue into master with commit ce156fa Feb 19, 2025
122 of 125 checks passed
@nikitamikhaylov nikitamikhaylov deleted the negging branch February 19, 2025 21:51
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants