scylladb icon indicating copy to clipboard operation
scylladb copied to clipboard

WIP: cql: forbid having counter columns in tablets tables

Open ptrsmrn opened this issue 1 year ago • 6 comments

(WIP: need to run the tests to see which ones break and fix them + possibly add some tests) Counter updates break under tablet migration (#18180), and for this reason counters need to be disabled until the problem is fixed. It's enough to forbid creating a table with counters, as altering a table without counters already cannot result in the table having counters:

  1. Adding a counter column to a table without counters:
cqlsh> ALTER TABLE temp.cf ADD (col_name counter);
ConfigurationException: Cannot add a counter column (col_name) in a non counter column family
  1. Altering a column to be of the counter type:
cqlsh> ALTER TABLE temp.cf ALTER col_name TYPE counter;
ConfigurationException: Cannot change col_name from type int to type counter: types are incompatible.

Fixes: #19449 Fixes: https://github.com/scylladb/scylladb/issues/18876

Need to backport to 6.0, as this is broken there.

ptrsmrn avatar Jun 27 '24 07:06 ptrsmrn

I have some issue reference nitpicks.

Also, please consider also doing #18876 - you need to also mention counters as not being supported on the CREATE TABLE error message, so while at it, you can fix the entire warning message.

I saw it but thought I'd have to do it in a separate PR, but I can fix it in this PR under a different commit.

Finally, don't we have a document we need to update, to say that with tablets you can't create counters - not just LWT, Alternator (because of LWT) and CDC?

I can check it and cover every disabled feature (in this PR).

ptrsmrn avatar Jun 27 '24 11:06 ptrsmrn

:red_circle: CI State: FAILURE

:white_check_mark: - Build :x: - Unit Tests Custom The following new/updated tests ran 100 times for each mode: :small_blue_diamond: cql-pytest/test_cast_data :small_blue_diamond: cql-pytest/test_counter :small_blue_diamond: cql-pytest/test_tools :small_blue_diamond: cql-pytest/test_unset :small_blue_diamond: cql-pytest/test_wasm

Failed Tests (1858/4740):

Build Details:

  • Duration: 43 min
  • Builder: spider5.cloudius-systems.com

scylladb-promoter avatar Jun 27 '24 12:06 scylladb-promoter

:red_circle: CI State: FAILURE

:white_check_mark: - Build :x: - Unit Tests Custom The following new/updated tests ran 100 times for each mode: :small_blue_diamond: cql-pytest/test_cast_data :small_blue_diamond: cql-pytest/test_counter :small_blue_diamond: cql-pytest/test_tools :small_blue_diamond: cql-pytest/test_unset :small_blue_diamond: cql-pytest/test_wasm

Failed Tests (58/4770):

Build Details:

  • Duration: 1 hr 57 min
  • Builder: spider7.cloudius-systems.com

scylladb-promoter avatar Jun 28 '24 09:06 scylladb-promoter

Docs Preview :book:

Docs Preview for this pull request is available here

Changed Files:

Note: This preview will be available for 30 days and will be automatically deleted after that period. You can manually trigger a new build by committing changes.

scylladb-promoter avatar Jun 28 '24 11:06 scylladb-promoter

:red_circle: CI State: FAILURE

:white_check_mark: - Build :white_check_mark: - Unit Tests Custom The following new/updated tests ran 100 times for each mode: :small_blue_diamond: cql-pytest/test_cast_data :small_blue_diamond: cql-pytest/test_counter :small_blue_diamond: cql-pytest/test_tools :small_blue_diamond: cql-pytest/test_unset :small_blue_diamond: cql-pytest/test_wasm :white_check_mark: - Container Test :x: - Unit Tests :white_check_mark: - dtest with topology changes :white_check_mark: - dtest

Failed Tests (69/78922):

Build Details:

  • Duration: 7 hr 12 min
  • Builder: spider7.cloudius-systems.com

scylladb-promoter avatar Jun 28 '24 19:06 scylladb-promoter

@kbr-scylla test/topology_experimental_raft/test_fencing.py::test_fence_writes fails (as expected) on:

>       table2 = await random_tables.add_table(name='t2', pks=1, columns=[
            Column("pk", IntType),
            Column('counter_c', CounterType)
        ])

when I disable creating tablets tables with counter columns (this is the purpose of this PR). How to make this test passing, should I:

  1. change the offending column type to be e.g. of TextType?
  2. skip table2 altogether for tablets case, because we were testing counters specifically? I assume we want to only change the problematic part and leave the remaining part of the test untouched.

ptrsmrn avatar Jul 03 '24 19:07 ptrsmrn

:red_circle: CI State: FAILURE

:white_check_mark: - Build :white_check_mark: - Container Test :white_check_mark: - dtest :white_check_mark: - dtest with topology changes :x: - Unit Tests

Failed Tests (9/31343):

Build Details:

  • Duration: 2 hr 16 min
  • Builder: spider7.cloudius-systems.com

scylladb-promoter avatar Jul 03 '24 22:07 scylladb-promoter

@ptrsmrn I'd parameterize the test to run with and without tablets, and then in the tablets case skip checking the counter column.

For example of parameterizing see test/topology_experimental_raft/test_topology_ops.py:

@pytest.mark.parametrize("tablets_enabled", [True, False])
async def test_topology_ops(request, manager: ManagerClient, tablets_enabled: bool):

kbr-scylla avatar Jul 04 '24 09:07 kbr-scylla

:red_circle: CI State: FAILURE

:white_check_mark: - Build :white_check_mark: - Container Test :x: - dtest with topology changes :white_check_mark: - dtest :white_check_mark: - Unit Tests

Failed Tests (2/31349):

Build Details:

  • Duration: 5 hr 36 min
  • Builder: i-04c10d715215d2d4e (m5ad.8xlarge)

scylladb-promoter avatar Jul 04 '24 15:07 scylladb-promoter

CI failed on a flaky dtest, the Issue against this failure has been already opened, I linked this failure to that ticket - https://github.com/scylladb/scylladb/issues/19620#issuecomment-2209489290 @nyh can you re-review please?

ptrsmrn avatar Jul 04 '24 19:07 ptrsmrn

I've left some suggestions.

@annastuchlik thanks, I've resolved them.

ptrsmrn avatar Jul 05 '24 12:07 ptrsmrn

:green_circle: CI State: SUCCESS

:white_check_mark: - Build :white_check_mark: - Container Test :white_check_mark: - dtest :white_check_mark: - dtest with topology changes :white_check_mark: - Unit Tests

Build Details:

  • Duration: 2 hr 19 min
  • Builder: spider2.cloudius-systems.com

scylladb-promoter avatar Jul 05 '24 14:07 scylladb-promoter

cling-tidy failure is unrelated to this PR, as in https://github.com/scylladb/scylladb/pull/18842#issuecomment-2209266931

ptrsmrn avatar Jul 05 '24 14:07 ptrsmrn

@nyh can you please review?

ptrsmrn avatar Jul 08 '24 10:07 ptrsmrn

:green_circle: CI State: SUCCESS

:white_check_mark: - Build :white_check_mark: - Container Test :white_check_mark: - dtest :white_check_mark: - dtest with topology changes :white_check_mark: - Unit Tests

Build Details:

  • Duration: 5 hr 50 min
  • Builder: i-092bf5f3ced2c89d0 (m5ad.8xlarge)

scylladb-promoter avatar Jul 09 '24 22:07 scylladb-promoter

@ptrsmrn This is the one to revert , it;s currently breaking dtest-release

yaronkaikov avatar Jul 12 '24 14:07 yaronkaikov

For the record, this change wasn't reverted after all, since the dtest fixes were merged in time, so #19720 was closed without merging.

@ptrsmrn can you please prepare a backport to 2024.2? (https://github.com/scylladb/scylla-dtest/pull/4974 is already in)

Cc @tzach @nyh

bhalevy avatar Nov 25 '24 07:11 bhalevy

2024.2 backport: https://github.com/scylladb/scylla-enterprise/pull/4985

ptrsmrn avatar Nov 26 '24 08:11 ptrsmrn