Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #57598 (ROLLBACK should be no-op...) #60338

Merged
merged 10 commits into from Mar 19, 2024

Conversation

PapaToemmsn
Copy link
Contributor

@PapaToemmsn PapaToemmsn commented Feb 22, 2024

Change to verify proper behaviour for ROLLBACK should be no-op when no active tranaction is running (MySQL compatibility) #57598

Changelog category (leave one):

  • Improvement

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

Issue #57598 mentions a variant behaviour regarding transaction handling. An issued COMMIT/ROLLBACK when no transaction is active is reported as an error contrary to MySQL behaviour.

This leads to breaking the MySQL compatibility layer as some tools rely on the MySQL way to handle transactions.

Changes were tested in an environment where Clickhouse was used as a MySQL replacement.

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Feb 22, 2024
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-bugfix Pull request with bugfix, not backported by default label Feb 22, 2024
@robot-ch-test-poll1
Copy link
Contributor

robot-ch-test-poll1 commented Feb 22, 2024

This is an automated comment for commit fbc8a19 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
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process❌ failure
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Mergeable CheckChecks if all other necessary checks are successful❌ failure
Successful checks
Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
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
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/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
Docs checkBuilds and tests the documentation✅ 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
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ 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
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ 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

@PapaToemmsn
Copy link
Contributor Author

Tried to search for information/docs on how to proceed as the results of the tests mostly seem unrelated to my changes done (e.g. "DB::Exception: io_uring is not supported by this system:" is a nerror message for quite a lot of the failed tests).

Since I was not successful in finding hints regarding these problems any hint will be greatly appreciated.

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-feature Pull request with new product feature and removed pr-bugfix Pull request with bugfix, not backported by default labels Feb 27, 2024
@alexey-milovidov alexey-milovidov removed the pr-feature Pull request with new product feature label Feb 29, 2024
@alexey-milovidov
Copy link
Member

The main problem is:

Bugfix validation — New test(s) failed to reproduce a bug

I've changed it to "Imrovement".

@alexey-milovidov
Copy link
Member

PR Check — expect adding docs for pr-feature

It looks like it was also mislabeled as "New Feature"

@@ -6,8 +6,8 @@ drop table if exists mt2;
create table mt1 (n Int64) engine=MergeTree order by n;
create table mt2 (n Int64) engine=MergeTree order by n;

commit; -- { serverError INVALID_TRANSACTION } -- no transaction
rollback; -- { serverError INVALID_TRANSACTION }
commit;
Copy link
Member

Choose a reason for hiding this comment

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

It should apply only to the MySQL compatibility. I don't think this change is correct. We can ask @tavplubix

Copy link
Member

Choose a reason for hiding this comment

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

I prefer the strict version (and for rollback as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that this way it breaks MySQL tools as cited in #57598 so that Clickhouse can't be used as a drop in replacement for MySQL.
I share your opinion that the strict version makes sense but this denies easy usage in such scenarios.

Is there a way to get the information that the query is coming from MySQL port from the session context? If so this behaviour could be set only for such queries. Woudl that be a satisfying solution for you @tavplubix ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it makes sense, see Context::getClientInfo() and ClientInfo::Interface

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tavplubix

Yes, it makes sense, see Context::getClientInfo() and ClientInfo::Interface

Thank you for your indications. I have changed the code based on ClientInfo::Interface to show this behaviour only for MySQL interfaces. I reverted back the test and created a new one for the MySQL client to verify the new behaviour.

Is there anything else I need to do to make this pull request mergeable?

CI seems ok as the 6 tests that did not work are no related to my changes.

Thank you!

@robot-ch-test-poll robot-ch-test-poll added the pr-improvement Pull request with some product improvements label Mar 13, 2024
PapaToemmsn and others added 8 commits March 18, 2024 14:14
Change to verify proper behaviour for ROLLBACK should be no-op when no active tranaction is running (MySQL compatibility) ClickHouse#57598
…ion active bahaviour

Adapted transaction test queries to changed beahviour
As changes in Txn handling for COMMIT and ROLLBACK should only be honoured for MySQL client mode the test was reverted back
@tavplubix tavplubix merged commit dd50091 into ClickHouse:master Mar 19, 2024
214 of 219 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 19, 2024
@tavplubix tavplubix self-assigned this Mar 19, 2024
@PapaToemmsn PapaToemmsn deleted the test-transaction-fixes branch April 2, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements 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.

None yet

8 participants