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
validation of cql create statement options should happen when it is created, not when executed #14710
Comments
@kostja please have a look |
@bhalevy why is this test not part of gating? |
Most likely since no one added it to gating. |
@bhalevy Raft schema state machine is stopped in the test, thanks to this exception: The underlying problem is that min_sstable_size presence is not checked during statemenet, prepare, only checked during execute/apply, which is too late. If we can't apply a committed Raft command, the schema state machine must be stopped. I don't know why it didn't fail before - this is the puzzling part. There were changes to option validation for keyspaces recently (e.g. #13986) but nothing relevant to this exception I can find. The test is added in 2022. Not added to the gating. Could have been done in test.py just as well, already then. |
@fruch it looks like nodetool_additional_test is indeed not part of next_gating. However, @kostja, even if it was, it fails like this only when raft is enabled. |
The source location is useless here since this is the file:line numbers of state_machine_error::state_machine_error, not where it is called.
@kostja the test tries to create the table twice.
But then the test retries creating the table, not with default options, but it got the same exception
Can your team please bisect the branch and see what triggers the failure? |
|
@bhalevy I wrote earlier: the check for options can't happen during statement execute, it must happen during statement prepare. Right now it happens in execute, in the compaction_strategy class, when the command is already committed to the raft log. If you're looking for the offending patch, I guess gleb's refactors for schema commitlog commitguard could be the trigger. But not the root cause. |
The sequence of events is:
|
Bisecting dtest is a sad effort. What needs to be done, is adding a test.py test case, bisecting on it, and adding a prepare-time validation for column family/keyspace options. |
It seems like the issue hit with raft enabled is just another manifestation of #7811 |
No vulnerable branches, not backporting. |
@avikivity the issue is also hit sporadically in older branches. |
@avikivity @denesb 5.2 / 2023.1 are vulnerable too, please backport. |
Is this fixing a regression? Or is this something that was always broken? In the latter case, all branches are vulnerable. |
It's not a regression AFAIK, but it is causing CI stability issues. |
After looking at the PR fixing this, it seems it fixes a regression, in releases that have consistent schema changes. Those releases will choke on an invalid create/alter statement. |
5.4 already has the fix. |
Fix is required in 5.2 on top of bfd8401 (5.2.11) |
@Deexie ping for backport PR. |
…' from Aleksandra Martyniuk Table properties validation is performed on statement execution. Thus, when one attempts to create a table with invalid options, an incorrect command gets committed in Raft. But then its application fails, leading to a raft machine being stopped. Check table properties when create and alter statements are prepared. Fixes: #14710. Closes #16750 * github.com:scylladb/scylladb: cql3: statements: delete execute override cql3: statements: call check_restricted_table_properties in prepare cql3: statements: pass data_dictionary::database to check_restricted_table_properties
Backported to 5.2. |
The dtest fails consistently since https://jenkins.scylladb.com/job/scylla-master/job/dtest-daily-release-with-raft/148/testReport/nodetool_additional_test/TestNodetool/Run_Dtest_Parallel_Cloud_Machines___FullDtest___full_split004___test_resetlocalschema_api_issue_7811_SizeTieredCompactionStrategy_/
The text was updated successfully, but these errors were encountered: