diff --git a/cql3/statements/ks_prop_defs.cc b/cql3/statements/ks_prop_defs.cc index ac93306322..7a08583ef3 100644 --- a/cql3/statements/ks_prop_defs.cc +++ b/cql3/statements/ks_prop_defs.cc @@ -30,12 +30,6 @@ static std::map prepare_options( return options; } - auto itt = options.find("initial_tablets"); - if (itt != options.end()) { - initial_tablets = std::stol(itt->second); - options.erase(itt); - } - // For users' convenience, expand the 'replication_factor' option into a replication factor for each DC. // If the user simply switches from another strategy without providing any options, // but the other strategy used the 'replication_factor' option, it will also be expanded. @@ -83,7 +77,7 @@ void ks_prop_defs::validate() { return; } - static std::set keywords({ sstring(KW_DURABLE_WRITES), sstring(KW_REPLICATION), sstring(KW_STORAGE) }); + static std::set keywords({ sstring(KW_DURABLE_WRITES), sstring(KW_REPLICATION), sstring(KW_STORAGE), sstring(KW_TABLETS) }); property_definitions::validate(keywords); auto replication_options = get_replication_options(); @@ -114,13 +108,43 @@ data_dictionary::storage_options ks_prop_defs::get_storage_options() const { return opts; } +std::optional ks_prop_defs::get_initial_tablets(const sstring& strategy_class) const { + // FIXME -- this should be ignored somehow else + if (locator::abstract_replication_strategy::to_qualified_class_name(strategy_class) != "org.apache.cassandra.locator.NetworkTopologyStrategy") { + return std::nullopt; + } + + auto tablets_options = get_map(KW_TABLETS); + if (!tablets_options) { + return std::nullopt; + } + + std::optional ret; + + auto it = tablets_options->find("initial"); + if (it != tablets_options->end()) { + try { + ret = std::stol(it->second); + } catch (...) { + throw exceptions::configuration_exception(sstring("Initial tablets value should be numeric; found ") + it->second); + } + tablets_options->erase(it); + } + + if (!tablets_options->empty()) { + throw exceptions::configuration_exception(sstring("Unrecognized tablets option ") + tablets_options->begin()->first); + } + + return ret; +} + std::optional ks_prop_defs::get_replication_strategy_class() const { return _strategy_class; } lw_shared_ptr ks_prop_defs::as_ks_metadata(sstring ks_name, const locator::token_metadata& tm) { auto sc = get_replication_strategy_class().value(); - std::optional initial_tablets; + std::optional initial_tablets = get_initial_tablets(sc); auto options = prepare_options(sc, tm, get_replication_options(), initial_tablets); return data_dictionary::keyspace_metadata::new_keyspace(ks_name, sc, std::move(options), initial_tablets, get_boolean(KW_DURABLE_WRITES, true), get_storage_options()); @@ -132,6 +156,7 @@ lw_shared_ptr ks_prop_defs::as_ks_metadata_u auto sc = get_replication_strategy_class(); std::optional initial_tablets; if (sc) { + initial_tablets = get_initial_tablets(*sc); options = prepare_options(*sc, tm, get_replication_options(), initial_tablets, old_options); } else { sc = old->strategy_name(); diff --git a/cql3/statements/ks_prop_defs.hh b/cql3/statements/ks_prop_defs.hh index 72b9f86dcd..cc8334c768 100644 --- a/cql3/statements/ks_prop_defs.hh +++ b/cql3/statements/ks_prop_defs.hh @@ -41,6 +41,7 @@ public: static constexpr auto KW_DURABLE_WRITES = "durable_writes"; static constexpr auto KW_REPLICATION = "replication"; static constexpr auto KW_STORAGE = "storage"; + static constexpr auto KW_TABLETS = "tablets"; static constexpr auto REPLICATION_STRATEGY_CLASS_KEY = "class"; static constexpr auto REPLICATION_FACTOR_KEY = "replication_factor"; @@ -50,6 +51,7 @@ public: void validate(); std::map get_replication_options() const; std::optional get_replication_strategy_class() const; + std::optional get_initial_tablets(const sstring& strategy_class) const; data_dictionary::storage_options get_storage_options() const; lw_shared_ptr as_ks_metadata(sstring ks_name, const locator::token_metadata&); lw_shared_ptr as_ks_metadata_update(lw_shared_ptr old, const locator::token_metadata&); diff --git a/docs/cql/ddl.rst b/docs/cql/ddl.rst index cfdcfbfbb0..29ad24fd1d 100644 --- a/docs/cql/ddl.rst +++ b/docs/cql/ddl.rst @@ -122,6 +122,7 @@ name kind mandatory default description details below). ``durable_writes`` *simple* no true Whether to use the commit log for updates on this keyspace (disable this option at your own risk!). +``tablets`` *map* no Experimental - enables tablets for this keyspace (see :ref:`tablets`) =================== ========== =========== ========= =================================================================== The ``replication`` property is mandatory and must at least contains the ``'class'`` sub-option, which defines the @@ -142,7 +143,6 @@ query latency. For a production ready strategy, see *NetworkTopologyStrategy* . sub-option type since description ========================= ====== ======= ============================================= ``'replication_factor'`` int all The number of replicas to store per range -``'initial_tablets'`` int 5.4 Experimental - enables tablets for this keyspace (see :ref:`initial_tablets`) ========================= ====== ======= ============================================= .. note:: Using NetworkTopologyStrategy is recommended. Using SimpleStrategy will make it harder to add Data Center in the future. @@ -166,7 +166,6 @@ sub-option type description definitions or explicit datacenter settings. For example, to have three replicas per datacenter, supply this with a value of 3. -``'initial_tablets'`` int (since 5.4) Experimental - enables tablets for this keyspace (see :ref:`initial_tablets`) ===================================== ====== ============================================= Note that when ``ALTER`` ing keyspaces and supplying ``replication_factor``, @@ -212,16 +211,24 @@ An example that excludes a datacenter while using ``replication_factor``:: on Amazon S3 or another S3-compatible object store. See :ref:`Keyspace storage options ` for details. -.. _initial-tablets: +.. _tablets: -The ``initial_tablets`` option :label-caution:`Experimental` +The ``tablets`` property :label-caution:`Experimental` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``initial_tablets`` option is used to specify how many tablets the table is split into. +The ``tablets`` property is used to make keyspace replication tablets-based. It is only valid when ``experimental_features: tablets`` is specified in ``scylla.yaml`` (which in turn requires ``consistent_cluster_management: true``); it must be a power of two. -A good rule of thumb to calculate initial_tablets is to divide the expected total storage used +Options: + +===================================== ====== ============================================= +sub-option type description +===================================== ====== ============================================= +``'initial'`` int The number of tablets to start with +===================================== ====== ============================================= + +A good rule of thumb to calculate initial tablets is to divide the expected total storage used by tables in this keyspace by (``replication_factor`` * 5GB). For example, if you expect a 30TB table and have a replication factor of 3, divide 30TB by (3*5GB) for a result of 2000. Since the value must be a power of two, round up to 2048. @@ -232,7 +239,7 @@ value must be a power of two, round up to 2048. in the future. .. caution:: - The ``initial_tablets`` option may change its definition or be completely removed as it is part + The ``initial`` option may change its definition or be completely removed as it is part of an experimental feature. @@ -242,7 +249,8 @@ An example that creates a keyspace with 2048 tablets per table:: WITH replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 3, - 'initial_tablets': 2048 + } AND tablets = { + 'initial': 2048 }; .. _use-statement: diff --git a/locator/tablets.cc b/locator/tablets.cc index 348ea2123e..91d7add407 100644 --- a/locator/tablets.cc +++ b/locator/tablets.cc @@ -525,11 +525,6 @@ void tablet_aware_replication_strategy::validate_tablet_options(const abstract_r void tablet_aware_replication_strategy::process_tablet_options(abstract_replication_strategy& ars, replication_strategy_config_options& opts, replication_strategy_params params) { - auto i = opts.find("initial_tablets"); - if (i != opts.end()) { - throw exceptions::configuration_exception("initial_tablets is reserved name for NetworkTopologyStrategy"); - } - if (params.initial_tablets.has_value()) { _initial_tablets = *params.initial_tablets; ars._uses_tablets = true; diff --git a/test/boost/cql_query_test.cc b/test/boost/cql_query_test.cc index 20b4745b23..db0a0c4542 100644 --- a/test/boost/cql_query_test.cc +++ b/test/boost/cql_query_test.cc @@ -5730,7 +5730,7 @@ bool has_tablet_routing(::shared_ptr re SEASTAR_TEST_CASE(test_sending_tablet_info_unprepared_insert) { BOOST_ASSERT(smp::count == 2); return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 8};").get(); + e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1 } and tablets = {'initial': 8};").get(); e.execute_cql("create table ks_tablet.test_tablet (pk int, ck int, v int, PRIMARY KEY (pk, ck));").get(); smp::submit_to(0, [&] { @@ -5751,7 +5751,7 @@ SEASTAR_TEST_CASE(test_sending_tablet_info_unprepared_insert) { SEASTAR_TEST_CASE(test_sending_tablet_info_unprepared_select) { return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 8};").get(); + e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1 } and tablets = {'initial': 8};").get(); e.execute_cql("create table ks_tablet.test_tablet (pk int, ck int, v int, PRIMARY KEY (pk, ck));").get(); e.execute_cql("insert into ks_tablet.test_tablet (pk, ck, v) VALUES (1, 2, 3);").get(); @@ -5773,7 +5773,7 @@ SEASTAR_TEST_CASE(test_sending_tablet_info_unprepared_select) { SEASTAR_TEST_CASE(test_sending_tablet_info_insert) { return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 8};").get(); + e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1 } and tablets = {'initial': 8};").get(); e.execute_cql("create table ks_tablet.test_tablet (pk int, ck int, v int, PRIMARY KEY (pk, ck));").get(); auto insert = e.prepare("insert into ks_tablet.test_tablet (pk, ck, v) VALUES (?, ?, ?);").get0(); @@ -5816,7 +5816,7 @@ SEASTAR_TEST_CASE(test_sending_tablet_info_insert) { SEASTAR_TEST_CASE(test_sending_tablet_info_select) { return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 8};").get(); + e.execute_cql("create keyspace ks_tablet with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} and tablets = {'initial': 8};").get(); e.execute_cql("create table ks_tablet.test_tablet (pk int, ck int, v int, PRIMARY KEY (pk, ck));").get(); e.execute_cql("insert into ks_tablet.test_tablet (pk, ck, v) VALUES (1, 2, 3);").get(); diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index 365cba2ad8..50199ad60a 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -396,8 +396,8 @@ public: } future<> create_keyspace(const cql_test_config& cfg, std::string_view name) { - auto query = format("create keyspace {} with replication = {{ 'class' : 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'replication_factor' : 1{}}};", name, - cfg.initial_tablets ? format(", 'initial_tablets' : {}", *cfg.initial_tablets) : ""); + auto query = format("create keyspace {} with replication = {{ 'class' : 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'replication_factor' : 1}}{};", name, + cfg.initial_tablets ? format(" and tablets = {{'initial' : {}}}", *cfg.initial_tablets) : ""); return execute_cql(query).discard_result(); } diff --git a/test/topology/test_topology_failure_recovery.py b/test/topology/test_topology_failure_recovery.py index 2190fdfe29..64a43ef681 100644 --- a/test/topology/test_topology_failure_recovery.py +++ b/test/topology/test_topology_failure_recovery.py @@ -83,8 +83,7 @@ async def test_tablet_drain_failure_during_decommission(manager: ManagerClient): marks = [await log.mark() for log in logs] cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 1, 'initial_tablets': 32};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 32};") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int);") logger.info("Populating table") diff --git a/test/topology_custom/test_tablets.py b/test/topology_custom/test_tablets.py index 3fe6d3946c..dbabdfca36 100644 --- a/test/topology_custom/test_tablets.py +++ b/test/topology_custom/test_tablets.py @@ -21,7 +21,7 @@ async def test_tablet_change_replication_vnode_to_tablets(manager: ManagerClient cql = manager.get_cql() await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1};") with pytest.raises(InvalidRequest): - await cql.run_async("ALTER KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 1};") + await cql.run_async("ALTER KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1};") @pytest.mark.asyncio @@ -48,7 +48,7 @@ async def test_tablet_default_initialization(manager: ManagerClient): server = await manager.server_add(config=cfg) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 1};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1};") res = await cql.run_async("SELECT * FROM system_schema.scylla_keyspaces WHERE keyspace_name = 'test'") assert res[0].initial_tablets > 0, "initial_tablets not configured" @@ -70,8 +70,8 @@ async def test_tablet_change_initial_tablets(manager: ManagerClient): server = await manager.server_add(config=cfg) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 1};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1};") - await cql.run_async("ALTER KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 2};") + await cql.run_async("ALTER KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 2};") res = await cql.run_async("SELECT * FROM system_schema.scylla_keyspaces WHERE keyspace_name = 'test'") assert res[0].initial_tablets == 2, "initial_tablets not altered" diff --git a/test/topology_experimental_raft/test_mv_tablets.py b/test/topology_experimental_raft/test_mv_tablets.py index 16114895f7..df3f70afaf 100644 --- a/test/topology_experimental_raft/test_mv_tablets.py +++ b/test/topology_experimental_raft/test_mv_tablets.py @@ -86,7 +86,7 @@ async def test_tablet_mv_create(manager: ManagerClient): servers = await manager.servers_add(1) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 100}") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 100}") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int)") await cql.run_async("CREATE MATERIALIZED VIEW test.tv AS SELECT * FROM test.test WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (c, pk)") await cql.run_async("DROP KEYSPACE test") @@ -104,7 +104,7 @@ async def test_tablet_mv_simple(manager: ManagerClient): servers = await manager.servers_add(1) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 100}") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 100}") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int)") await cql.run_async("CREATE MATERIALIZED VIEW test.tv AS SELECT * FROM test.test WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (c, pk) WITH SYNCHRONOUS_UPDATES = TRUE") await cql.run_async("INSERT INTO test.test (pk, c) VALUES (2, 3)") @@ -126,7 +126,7 @@ async def test_tablet_mv_simple_6node(manager: ManagerClient): """ servers = await manager.servers_add(6) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 100}") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 100}") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int)") await cql.run_async("CREATE MATERIALIZED VIEW test.tv AS SELECT * FROM test.test WHERE c IS NOT NULL AND pk IS NOT NULL PRIMARY KEY (c, pk) WITH SYNCHRONOUS_UPDATES = TRUE") await cql.run_async("INSERT INTO test.test (pk, c) VALUES (2, 3)") @@ -262,7 +262,7 @@ async def test_tablet_si_create(manager: ManagerClient): servers = await manager.servers_add(1) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 100}") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 100}") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int)") await cql.run_async("CREATE INDEX my_idx ON test.test(c)") await cql.run_async("DROP INDEX test.my_idx") @@ -277,7 +277,7 @@ async def test_tablet_lsi_create(manager: ManagerClient): servers = await manager.servers_add(1) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 100}") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 100}") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int)") await cql.run_async("CREATE INDEX my_idx ON test.test((pk),c)") await cql.run_async("DROP INDEX test.my_idx") @@ -306,7 +306,7 @@ async def test_tablet_cql_lsi(manager: ManagerClient): # Create a table with an LSI, using tablets. Use just 1 tablets, # which is silly in any real-world use case, but makes this test simpler # and faster. - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 1}") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1}") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int)") await cql.run_async("CREATE INDEX my_idx ON test.test((pk),c)") diff --git a/test/topology_experimental_raft/test_tablets.py b/test/topology_experimental_raft/test_tablets.py index 6a0e6c9e48..d1003d6944 100644 --- a/test/topology_experimental_raft/test_tablets.py +++ b/test/topology_experimental_raft/test_tablets.py @@ -91,8 +91,7 @@ async def test_tablet_metadata_propagates_with_schema_changes_in_snapshot_mode(m await manager.server_stop_gracefully(s0) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 3, 'initial_tablets': 100};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3} AND tablets = {'initial': 100};") # force s0 to catch up later from the snapshot and not the raft log await inject_error_one_shot_on(manager, 'raft_server_force_snapshot', not_s0) @@ -113,8 +112,7 @@ async def test_tablet_metadata_propagates_with_schema_changes_in_snapshot_mode(m await wait_for_cql_and_get_hosts(cql, [servers[0]], time.time() + 60) # Trigger a schema change to invoke schema agreement waiting to make sure that s0 has the latest schema - await cql.run_async("CREATE KEYSPACE test_dummy WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 1, 'initial_tablets': 1};") + await cql.run_async("CREATE KEYSPACE test_dummy WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1};") await asyncio.gather(*[cql.run_async(f"INSERT INTO test.test (pk, c) VALUES ({k}, 2);", execution_profile='whitelist') for k in keys]) @@ -154,8 +152,7 @@ async def test_scans(manager: ManagerClient): servers = await manager.servers_add(3) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 1, 'initial_tablets': 8};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 8};") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int);") keys = range(100) @@ -185,7 +182,7 @@ async def test_table_drop_with_auto_snapshot(manager: ManagerClient): for i in range(3): await cql.run_async("DROP KEYSPACE IF EXISTS test;") - await cql.run_async("CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 8 };") + await cql.run_async("CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 8 };") await cql.run_async("CREATE TABLE IF NOT EXISTS test.tbl_sample_kv (id int, value text, PRIMARY KEY (id));") await cql.run_async("INSERT INTO test.tbl_sample_kv (id, value) VALUES (1, 'ala');") @@ -198,8 +195,7 @@ async def test_topology_changes(manager: ManagerClient): servers = await manager.servers_add(3) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 1, 'initial_tablets': 32};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 32};") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int);") logger.info("Populating table") @@ -247,8 +243,7 @@ async def test_streaming_is_guarded_by_topology_guard(manager: ManagerClient): await manager.api.disable_tablet_balancing(servers[0].ip_addr) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 1, 'initial_tablets': 1};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1};") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int);") servers.append(await manager.server_add(cmdline=cmdline)) @@ -323,8 +318,7 @@ async def test_table_dropped_during_streaming(manager: ManagerClient): await manager.api.disable_tablet_balancing(servers[0].ip_addr) cql = manager.get_cql() - await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', " - "'replication_factor': 1, 'initial_tablets': 1};") + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1} AND tablets = {'initial': 1};") await cql.run_async("CREATE TABLE test.test (pk int PRIMARY KEY, c int);") await cql.run_async("CREATE TABLE test.test2 (pk int PRIMARY KEY, c int);")