diff --git a/test/boost/cql_auth_query_test.cc b/test/boost/cql_auth_query_test.cc index f7586bb3af..5da350bce6 100644 --- a/test/boost/cql_auth_query_test.cc +++ b/test/boost/cql_auth_query_test.cc @@ -299,7 +299,7 @@ SEASTAR_TEST_CASE(create_keyspace_default_permissions) { env, alice, "GRANT CREATE ON ALL KEYSPACES TO alice", - "CREATE KEYSPACE armies WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }", + "CREATE KEYSPACE armies WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }", auth::make_data_resource("armies")); }, db_config_with_auth()); } diff --git a/test/boost/cql_query_test.cc b/test/boost/cql_query_test.cc index a01ddef2ec..4d96c8f697 100644 --- a/test/boost/cql_query_test.cc +++ b/test/boost/cql_query_test.cc @@ -49,7 +49,7 @@ using namespace std::literals::chrono_literals; SEASTAR_TEST_CASE(test_create_keyspace_statement) { return do_with_cql_env([] (cql_test_env& e) { - return e.execute_cql("create keyspace ks2 with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").discard_result().then([&e] { + return e.execute_cql("create keyspace ks2 with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").discard_result().then([&e] { return e.require_keyspace_exists("ks2"); }); }); @@ -1790,19 +1790,19 @@ SEASTAR_TEST_CASE(test_select_multiple_ranges) { SEASTAR_TEST_CASE(test_validate_keyspace) { return do_with_cql_env([] (cql_test_env& e) { return make_ready_future<>().then([&e] { - return e.execute_cql("create keyspace kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkssssssssssssssssssssssssssssssssssssssssssssss with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); + return e.execute_cql("create keyspace kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkssssssssssssssssssssssssssssssssssssssssssssss with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };"); }).then_wrapped([&e] (future> f) { assert_that_failed(f); - return e.execute_cql("create keyspace ks3-1 with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); + return e.execute_cql("create keyspace ks3-1 with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };"); }).then_wrapped([&e] (future> f) { assert_that_failed(f); return e.execute_cql("create keyspace ks3 with replication = { 'replication_factor' : 1 };"); }).then_wrapped([&e] (future> f) { assert_that_failed(f); - return e.execute_cql("create keyspace ks3 with rreplication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); + return e.execute_cql("create keyspace ks3 with rreplication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };"); }).then_wrapped([&e] (future> f) { assert_that_failed(f); - return e.execute_cql("create keyspace SyStEm with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"); + return e.execute_cql("create keyspace SyStEm with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };"); }).then_wrapped([] (future> f) { assert_that_failed(f); }); @@ -3202,7 +3202,7 @@ SEASTAR_TEST_CASE(test_time_conversions) { // range list. SEASTAR_TEST_CASE(test_empty_partition_range_scan) { return do_with_cql_env_thread([] (cql_test_env& e) { - e.execute_cql("create keyspace empty_partition_range_scan with replication = {'class': 'SimpleStrategy', 'replication_factor': 1};").get(); + e.execute_cql("create keyspace empty_partition_range_scan with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1};").get(); e.execute_cql("create table empty_partition_range_scan.tb (a int, b int, c int, val int, PRIMARY KEY ((a,b),c) );").get(); @@ -4309,7 +4309,7 @@ SEASTAR_TEST_CASE(test_describe_view_schema) { {"cf_index4_index", "CREATE INDEX cf_index4 ON \"KS\".\"cF\"((pk, pk1),col2);"} }; - e.execute_cql("CREATE KEYSPACE \"KS\" WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}").get(); + e.execute_cql("CREATE KEYSPACE \"KS\" WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}").get(); e.execute_cql(base_table).get(); for (auto &&ct : cql_create_tables) { diff --git a/test/boost/group0_test.cc b/test/boost/group0_test.cc index 224f487081..81cd2803b7 100644 --- a/test/boost/group0_test.cc +++ b/test/boost/group0_test.cc @@ -52,7 +52,7 @@ SEASTAR_TEST_CASE(test_abort_server_on_background_error) { if (has_ks) { co_await e.execute_cql("drop keyspace new_ks"); } else { - co_await e.execute_cql("create keyspace new_ks with replication = {'class': 'SimpleStrategy', 'replication_factor': 1}"); + co_await e.execute_cql("create keyspace new_ks with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}"); } has_ks = !has_ks; }; @@ -81,7 +81,7 @@ SEASTAR_TEST_CASE(test_group0_history_clearing_old_entries) { if (has_ks) { co_await e.execute_cql("drop keyspace new_ks"); } else { - co_await e.execute_cql("create keyspace new_ks with replication = {'class': 'SimpleStrategy', 'replication_factor': 1}"); + co_await e.execute_cql("create keyspace new_ks with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}"); } has_ks = !has_ks; }; @@ -172,7 +172,7 @@ SEASTAR_TEST_CASE(test_concurrent_group0_modifications) { size_t successes = 0; bool has_ks = false; auto drop_ks_cql = format("drop keyspace new_ks{}", task_id); - auto create_ks_cql = format("create keyspace new_ks{} with replication = {{'class': 'SimpleStrategy', 'replication_factor': 1}}", task_id); + auto create_ks_cql = format("create keyspace new_ks{} with replication = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}", task_id); auto perform = [&] () -> future<> { try { diff --git a/test/boost/memtable_test.cc b/test/boost/memtable_test.cc index dca11dc5c1..8ecdbea2e2 100644 --- a/test/boost/memtable_test.cc +++ b/test/boost/memtable_test.cc @@ -918,7 +918,7 @@ SEASTAR_TEST_CASE(memtable_flush_compresses_mutations) { // Create table and insert some data char const* ks_name = "keyspace_name"; char const* table_name = "table_name"; - env.execute_cql(format("CREATE KEYSPACE {} WITH REPLICATION = {{'class' : 'SimpleStrategy', 'replication_factor' : 1}};", ks_name)).get(); + env.execute_cql(format("CREATE KEYSPACE {} WITH REPLICATION = {{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}};", ks_name)).get(); env.execute_cql(format("CREATE TABLE {}.{} (pk int, ck int, id int, PRIMARY KEY(pk, ck));", ks_name, table_name)).get(); replica::database& db = env.local_db(); diff --git a/test/boost/mutation_reader_test.cc b/test/boost/mutation_reader_test.cc index 266ef0cb5d..04054bfa30 100644 --- a/test/boost/mutation_reader_test.cc +++ b/test/boost/mutation_reader_test.cc @@ -2163,7 +2163,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_fast_forwarded_with_pe SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_next_partition) { do_with_cql_env_thread([&] (cql_test_env& env) -> future<> { env.execute_cql("CREATE KEYSPACE multishard_combining_reader_next_partition_ks" - " WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};").get(); + " WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};").get(); env.execute_cql("CREATE TABLE multishard_combining_reader_next_partition_ks.test (pk int, v int, PRIMARY KEY(pk));").get(); const auto insert_id = env.prepare("INSERT INTO multishard_combining_reader_next_partition_ks.test (\"pk\", \"v\") VALUES (?, ?);").get0(); @@ -2249,7 +2249,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_streaming_reader) { } do_with_cql_env_thread([&] (cql_test_env& env) -> future<> { - env.execute_cql("CREATE KEYSPACE multishard_streaming_reader_ks WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};").get(); + env.execute_cql("CREATE KEYSPACE multishard_streaming_reader_ks WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};").get(); env.execute_cql("CREATE TABLE multishard_streaming_reader_ks.test (pk int, v int, PRIMARY KEY(pk));").get(); const auto insert_id = env.prepare("INSERT INTO multishard_streaming_reader_ks.test (\"pk\", \"v\") VALUES (?, ?);").get0(); diff --git a/test/boost/querier_cache_test.cc b/test/boost/querier_cache_test.cc index d63a129e64..7eb77fc8b3 100644 --- a/test/boost/querier_cache_test.cc +++ b/test/boost/querier_cache_test.cc @@ -630,7 +630,7 @@ SEASTAR_THREAD_TEST_CASE(test_resources_based_cache_eviction) { // expected } - env.execute_cql("CREATE KEYSPACE querier_cache WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};").get(); + env.execute_cql("CREATE KEYSPACE querier_cache WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};").get(); env.execute_cql("CREATE TABLE querier_cache.test (pk int, ck int, value int, primary key (pk, ck));").get(); env.require_table_exists("querier_cache", "test").get(); diff --git a/test/boost/row_cache_test.cc b/test/boost/row_cache_test.cc index 276722a7bb..3e16505437 100644 --- a/test/boost/row_cache_test.cc +++ b/test/boost/row_cache_test.cc @@ -4433,7 +4433,7 @@ SEASTAR_TEST_CASE(test_populating_cache_with_expired_and_nonexpired_tombstones) env.execute_cql(format( "CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = " - "{{'class' : 'SimpleStrategy', 'replication_factor' : 1}};", ks_name)).get(); + "{{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}};", ks_name)).get(); env.execute_cql(format( "CREATE TABLE {}.{} (pk int, ck int, PRIMARY KEY(pk, ck));", ks_name, table_name)).get(); diff --git a/test/boost/schema_change_test.cc b/test/boost/schema_change_test.cc index 6322bdd6d1..cab8e7c85d 100644 --- a/test/boost/schema_change_test.cc +++ b/test/boost/schema_change_test.cc @@ -38,7 +38,7 @@ SEASTAR_TEST_CASE(test_new_schema_with_no_structural_change_is_propagated) { .with_column("pk", bytes_type, column_kind::partition_key) .with_column("v1", bytes_type); - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); auto old_schema = partial.build(); @@ -73,7 +73,7 @@ SEASTAR_TEST_CASE(test_schema_is_updated_in_keyspace) { .with_column("pk", bytes_type, column_kind::partition_key) .with_column("v1", bytes_type); - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); auto old_schema = builder.build(); @@ -108,7 +108,7 @@ SEASTAR_TEST_CASE(test_schema_is_updated_in_keyspace) { SEASTAR_TEST_CASE(test_tombstones_are_ignored_in_version_calculation) { return do_with_cql_env([](cql_test_env& e) { return seastar::async([&] { - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); auto table_schema = schema_builder("ks", "table") .with_column("pk", bytes_type, column_kind::partition_key) @@ -145,7 +145,7 @@ SEASTAR_TEST_CASE(test_tombstones_are_ignored_in_version_calculation) { SEASTAR_TEST_CASE(test_concurrent_column_addition) { return do_with_cql_env([](cql_test_env& e) { return seastar::async([&] { - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); service::migration_manager& mm = e.migration_manager().local(); @@ -222,7 +222,7 @@ SEASTAR_TEST_CASE(test_sort_type_in_update) { SEASTAR_TEST_CASE(test_column_is_dropped) { return do_with_cql_env([](cql_test_env& e) { return seastar::async([&] { - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("create table tests.table1 (pk int primary key, c1 int, c2 int);").get(); e.execute_cql("alter table tests.table1 drop c2;").get(); e.execute_cql("alter table tests.table1 add s1 int;").get(); @@ -237,7 +237,7 @@ SEASTAR_TEST_CASE(test_column_is_dropped) { SEASTAR_TEST_CASE(test_static_column_is_dropped) { return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("create table tests.table1 (pk int, c1 int, c2 int static, primary key (pk, c1));").get(); e.execute_cql("alter table tests.table1 drop c2;").get(); @@ -257,7 +257,7 @@ SEASTAR_TEST_CASE(test_static_column_is_dropped) { SEASTAR_TEST_CASE(test_multiple_columns_add_and_drop) { return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("create table tests.table1 (pk int primary key, c1 int, c2 int, c3 int);").get(); e.execute_cql("alter table tests.table1 drop (c2);").get(); @@ -282,7 +282,7 @@ SEASTAR_TEST_CASE(test_multiple_columns_add_and_drop) { SEASTAR_TEST_CASE(test_multiple_static_columns_add_and_drop) { return do_with_cql_env_thread([](cql_test_env& e) { - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("create table tests.table1 (pk int, c1 int, c2 int static, c3 int, primary key(pk, c1));").get(); e.execute_cql("alter table tests.table1 drop (c2);").get(); @@ -310,7 +310,7 @@ SEASTAR_TEST_CASE(test_combined_column_add_and_drop) { return seastar::async([&] { service::migration_manager& mm = e.migration_manager().local(); - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); auto s1 = schema_builder("ks", "table1") .with_column("pk", bytes_type, column_kind::partition_key) @@ -372,7 +372,7 @@ SEASTAR_TEST_CASE(test_concurrent_table_creation_with_different_schema) { return seastar::async([&] { service::migration_manager& mm = e.migration_manager().local(); - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); auto s1 = schema_builder("ks", "table1") .with_column("pk1", bytes_type, column_kind::partition_key) @@ -605,7 +605,7 @@ SEASTAR_TEST_CASE(test_notifications) { e.local_mnotifier().register_listener(&listener); auto listener_lease = defer([&e, &listener] { e.local_mnotifier().register_listener(&listener); }); - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); BOOST_REQUIRE_EQUAL(listener.create_keyspace_count, 1); @@ -690,7 +690,7 @@ SEASTAR_TEST_CASE(test_prepared_statement_is_invalidated_by_schema_change) { return do_with_cql_env([](cql_test_env& e) { return seastar::async([&] { logging::logger_registry().set_logger_level("query_processor", logging::log_level::debug); - e.execute_cql("create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + e.execute_cql("create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("create table tests.table1 (pk int primary key, c1 int, c2 int);").get(); auto id = e.prepare("select * from tests.table1;").get0(); @@ -752,7 +752,7 @@ future<> test_schema_digest_does_not_change_with_disabled_features(sstring data_ if (regenerate) { // Exercise many different kinds of schema changes. e.execute_cql( - "create keyspace tests with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + "create keyspace tests with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("create table tests.table1 (pk int primary key, c1 int, c2 int);").get(); e.execute_cql("create type tests.basic_info (c1 timestamp, v2 text);").get(); e.execute_cql("create index on tests.table1 (c1);").get(); @@ -762,7 +762,7 @@ future<> test_schema_digest_does_not_change_with_disabled_features(sstring data_ e.execute_cql( "create materialized view ks.tbl_view_2 AS SELECT a FROM ks.tbl WHERE a IS NOT NULL PRIMARY KEY (a)").get(); e.execute_cql( - "create keyspace tests2 with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };").get(); + "create keyspace tests2 with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 };").get(); e.execute_cql("drop keyspace tests2;").get(); extra_schema_changes(e); } @@ -926,7 +926,7 @@ SEASTAR_TEST_CASE(test_schema_digest_does_not_change_with_keyspace_storage_optio std::set{}, std::move(expected_digests), [] (cql_test_env& e) { - e.execute_cql("create keyspace tests_s3 with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }" + e.execute_cql("create keyspace tests_s3 with replication = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 }" " and storage = { 'type': 'S3', 'bucket': 'b1', 'endpoint': 'localhost' };").get(); e.execute_cql("create table tests_s3.table1 (pk int primary key, c1 int, c2 int)").get(); }); diff --git a/test/boost/schema_loader_test.cc b/test/boost/schema_loader_test.cc index 704d5bb12a..72d294dc57 100644 --- a/test/boost/schema_loader_test.cc +++ b/test/boost/schema_loader_test.cc @@ -16,18 +16,18 @@ SEASTAR_THREAD_TEST_CASE(test_empty) { } SEASTAR_THREAD_TEST_CASE(test_keyspace_only) { - BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};").get().size(), 0); + BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1};").get().size(), 0); } SEASTAR_THREAD_TEST_CASE(test_single_table) { BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE TABLE ks.cf (pk int PRIMARY KEY, v int)").get().size(), 1); BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE TABLE ks.cf (pk int PRIMARY KEY, v map)").get().size(), 1); - BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); + BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); } SEASTAR_THREAD_TEST_CASE(test_keyspace_replication_strategy) { - BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); - BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); + BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); + BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'mydc1': 1, 'mydc2': 4}; CREATE TABLE ks.cf (pk int PRIMARY KEY, v int);").get().size(), 1); } @@ -35,35 +35,35 @@ SEASTAR_THREAD_TEST_CASE(test_multiple_tables) { BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE TABLE ks.cf1 (pk int PRIMARY KEY, v int); CREATE TABLE ks.cf2 (pk int PRIMARY KEY, v int)").get().size(), 2); BOOST_REQUIRE_EQUAL(tools::load_schemas("CREATE TABLE ks.cf1 (pk int PRIMARY KEY, v int); CREATE TABLE ks.cf2 (pk int PRIMARY KEY, v int);").get().size(), 2); BOOST_REQUIRE_EQUAL(tools::load_schemas( - "CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TABLE ks.cf1 (pk int PRIMARY KEY, v int); " "CREATE TABLE ks.cf2 (pk int PRIMARY KEY, v int); " "CREATE TABLE ks.cf3 (pk int PRIMARY KEY, v int); " ).get().size(), 3); BOOST_REQUIRE_EQUAL(tools::load_schemas( - "CREATE KEYSPACE ks1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks1 WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TABLE ks1.cf (pk int PRIMARY KEY, v int); " - "CREATE KEYSPACE ks2 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks2 WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TABLE ks2.cf (pk int PRIMARY KEY, v int); " ).get().size(), 2); } SEASTAR_THREAD_TEST_CASE(test_udts) { BOOST_REQUIRE_EQUAL(tools::load_schemas( - "CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TYPE ks.type1 (f1 int, f2 text); " "CREATE TABLE ks.cf (pk int PRIMARY KEY, v frozen); " ).get().size(), 1); BOOST_REQUIRE_EQUAL(tools::load_schemas( - "CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TYPE ks.type1 (f1 int, f2 text); " "CREATE TABLE ks.cf (pk int PRIMARY KEY, v type1); " ).get().size(), 1); BOOST_REQUIRE_EQUAL(tools::load_schemas( - "CREATE KEYSPACE ks1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks1 WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TYPE ks1.type1 (f1 int, f2 text); " "CREATE TABLE ks1.cf (pk int PRIMARY KEY, v frozen); " - "CREATE KEYSPACE ks2 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; " + "CREATE KEYSPACE ks2 WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; " "CREATE TYPE ks2.type1 (f1 int, f2 text); " "CREATE TABLE ks2.cf (pk int PRIMARY KEY, v frozen); " ).get().size(), 2); diff --git a/test/boost/user_types_test.cc b/test/boost/user_types_test.cc index 0df693ca5a..7d507815a4 100644 --- a/test/boost/user_types_test.cc +++ b/test/boost/user_types_test.cc @@ -128,7 +128,7 @@ SEASTAR_TEST_CASE(test_invalid_user_type_statements) { "A user type cannot contain non-frozen user type fields"); // table cannot refer to UDT in another keyspace - e.execute_cql("create keyspace ks2 with replication={'class':'SimpleStrategy','replication_factor':1}").discard_result().get(); + e.execute_cql("create keyspace ks2 with replication={'class':'NetworkTopologyStrategy','replication_factor':1}").discard_result().get(); e.execute_cql("create type ks2.ut2 (a int)").discard_result().get(); REQUIRE_INVALID(e, "create table bad (a int primary key, b ks2.ut2)", "Statement on keyspace ks cannot refer to a user type in keyspace ks2; " diff --git a/test/cql-pytest/test_describe.py b/test/cql-pytest/test_describe.py index 38aa61f3bb..f95e873c13 100644 --- a/test/cql-pytest/test_describe.py +++ b/test/cql-pytest/test_describe.py @@ -469,7 +469,7 @@ def test_keyspaces_quoting(cql): # are the ones with capital letters. name = "Quoted_KS" - cql.execute(f"CREATE KEYSPACE \"{name}\" WITH REPLICATION = {{'class': 'SimpleStrategy', 'replication_factor': 1}}") + cql.execute(f"CREATE KEYSPACE \"{name}\" WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}") try: desc = cql.execute(f"DESC KEYSPACE \"{name}\"").one().create_statement @@ -494,7 +494,7 @@ def test_table_quoting(cql): name = "Quoted_TABLE" col_name = "!@#$%" - cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'SimpleStrategy', 'replication_factor': 1}}") + cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}") try: cql.execute(f"CREATE TABLE \"{ks_name}\".\"{name}\"(a int primary key, \"{col_name}\" int)") desc = cql.execute(f"DESC TABLE \"{ks_name}\".\"{name}\"").one().create_statement @@ -528,7 +528,7 @@ def test_type_quoting(cql): name = "udt_@@@" field_name = "field_!!!" - cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'SimpleStrategy', 'replication_factor': 1}}") + cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}") try: cql.execute(f"CREATE TYPE \"{ks_name}\".\"{name}\" (a int, \"{field_name}\" text)") desc = cql.execute(f"DESC TYPE \"{ks_name}\".\"{name}\"").one().create_statement @@ -553,7 +553,7 @@ def test_function_quoting(scylla_only, cql, test_keyspace): ks_name = "Quoted_KS" name = "!udf!" - cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'SimpleStrategy', 'replication_factor': 1}}") + cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}") try: cql.execute(f""" CREATE FUNCTION \"{ks_name}\".\"{name}\"(val int) @@ -583,7 +583,7 @@ def test_aggregate_quoting(scylla_only, cql, test_keyspace): sfunc_name = "!udf!" name = "'uda'!" - cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'SimpleStrategy', 'replication_factor': 1}}") + cql.execute(f"CREATE KEYSPACE \"{ks_name}\" WITH REPLICATION = {{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}}") try: cql.execute(f""" CREATE FUNCTION \"{ks_name}\".\"{sfunc_name}\"(val1 int, val2 int) diff --git a/test/cql-pytest/test_keyspace.py b/test/cql-pytest/test_keyspace.py index 0eb8d48222..0395bae6d2 100644 --- a/test/cql-pytest/test_keyspace.py +++ b/test/cql-pytest/test_keyspace.py @@ -194,7 +194,7 @@ def test_concurrent_create_and_drop_keyspace(cql, this_dc, fails_without_consist # Test that passing "LOCAL" parameter to storage options works as expected # and is not explicitly stored - since it's equal to the original storage def test_storage_options_local(cql, scylla_only): - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'LOCAL' }" with new_test_keyspace(cql, ksdef) as keyspace: res = cql.execute(f"SELECT * FROM system_schema.scylla_keyspaces WHERE keyspace_name = '{keyspace}'") @@ -202,7 +202,7 @@ def test_storage_options_local(cql, scylla_only): # Test that passing an unsupported storage type is not legal def test_storage_options_unknown_type(cql, scylla_only): - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'S4', 'bucket' : '42', 'endpoint' : 'localhost' }" with pytest.raises(InvalidRequest): with new_test_keyspace(cql, ksdef): @@ -210,12 +210,12 @@ def test_storage_options_unknown_type(cql, scylla_only): # Test that passing nonexistent options results in an error def test_storage_options_nonexistent_param(cql, scylla_only): - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'S3', 'bucket' : '42', 'endpoint' : 'localhost', 'superfluous' : 'info' }" with pytest.raises(InvalidRequest): with new_test_keyspace(cql, ksdef): pass - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'LOCAL', 'superfluous' : 'info' }" with pytest.raises(InvalidRequest): with new_test_keyspace(cql, ksdef): @@ -223,7 +223,7 @@ def test_storage_options_nonexistent_param(cql, scylla_only): # Test that not passing required parameters fails def test_storage_options_required_param(cql, scylla_only): - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'S3', 'bucket' : '42' }" with pytest.raises(InvalidRequest): with new_test_keyspace(cql, ksdef): @@ -232,18 +232,18 @@ def test_storage_options_required_param(cql, scylla_only): # Test that storage options cannot be altered (at least until it's well defined # what it means to e.g. switch from S3 to another format and back). def test_storage_options_alter_type(cql, scylla_only): - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'LOCAL' }" with new_test_keyspace(cql, ksdef) as keyspace: # It's not fine to change the storage type - ksdef_local = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef_local = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'S3', 'bucket' : '/b1', 'endpoint': 'localhost'}" with pytest.raises(InvalidRequest): res = cql.execute(f"ALTER KEYSPACE {keyspace} {ksdef_local}") # Test that server-side desc statement is able to describe storage options, when not local. def test_storage_options_describe(cql, scylla_only): - ksdef = "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' } " \ + ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = {'type': 'S3', 'bucket': '42', 'endpoint': 'localhost'}" with new_test_keyspace(cql, ksdef) as keyspace: diff --git a/test/cql-pytest/test_permissions.py b/test/cql-pytest/test_permissions.py index a7983eaa8f..bfdd552a00 100644 --- a/test/cql-pytest/test_permissions.py +++ b/test/cql-pytest/test_permissions.py @@ -86,11 +86,11 @@ def test_grant_revoke_data_permissions(cql, test_keyspace): ks = unique_name() # Permissions on all keyspaces def create_keyspace_idempotent(): - user_session.execute(f"CREATE KEYSPACE IF NOT EXISTS {ks} WITH REPLICATION = {{ 'class' : 'SimpleStrategy', 'replication_factor' : 1 }}") + user_session.execute(f"CREATE KEYSPACE IF NOT EXISTS {ks} WITH REPLICATION = {{ 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 }}") user_session.execute(f"DROP KEYSPACE IF EXISTS {ks}") check_enforced(cql, username, permission='CREATE', resource='ALL KEYSPACES', function=create_keyspace_idempotent) # Permissions for a specific keyspace - with new_test_keyspace(cql, "WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 }") as keyspace: t = unique_name() def create_table_idempotent(): user_session.execute(f"CREATE TABLE IF NOT EXISTS {keyspace}.{t}(id int primary key)") @@ -127,7 +127,7 @@ def test_grant_revoke_data_permissions(cql, test_keyspace): # Test that permissions for user-defined functions are serialized in a Cassandra-compatible way def test_udf_permissions_serialization(cql): schema = "a int primary key" - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace, new_user(cql) as user: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace, new_user(cql) as user: with new_test_table(cql, keyspace, schema) as table: # Creating a bilingual function makes this test case work for both Scylla and Cassandra div_body_lua = "(b bigint, i int) CALLED ON NULL INPUT RETURNS bigint LANGUAGE lua AS 'return b//i'" @@ -165,7 +165,7 @@ def test_udf_permissions_serialization(cql): def test_udf_permissions_quoted_names(cassandra_bug, cql): udt_name = f'"{unique_name()}weird_udt[t^t]a^b^[]"' schema = f"a frozen<{udt_name}> primary key" - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: with new_type(cql, keyspace, "(a text, b int)", udt_name) as udt, new_test_table(cql, keyspace, schema) as table: fun_body_lua = f"(i {udt}) CALLED ON NULL INPUT RETURNS bigint LANGUAGE lua AS 'return 42;'" fun_body_java = f"(i {udt}) CALLED ON NULL INPUT RETURNS bigint LANGUAGE java AS 'return 42;'" @@ -197,7 +197,7 @@ def test_udf_permissions_quoted_names(cassandra_bug, cql): # If the signature is specified, test that the permission check is performed as usual. def test_drop_udf_with_same_name(cql): schema = "a int primary key" - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: body1_lua = "(i int) CALLED ON NULL INPUT RETURNS bigint LANGUAGE lua AS 'return 42;'" body1_java = "(i int) CALLED ON NULL INPUT RETURNS bigint LANGUAGE java AS 'return Long.valueOf(42);'" body2_lua = "(i int, j int) CALLED ON NULL INPUT RETURNS bigint LANGUAGE lua AS 'return 42;'" @@ -229,7 +229,7 @@ def test_drop_udf_with_same_name(cql): def test_grant_revoke_udf_permissions(cql): schema = "a int primary key, b list" user = "cassandra" - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: with new_test_table(cql, keyspace, schema) as table: fun_body_lua = "(i int, l list) CALLED ON NULL INPUT RETURNS int LANGUAGE lua AS 'return 42;'" fun_body_java = "(i int, l list) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return 42;'" @@ -295,7 +295,7 @@ def test_grant_perms_on_nonexistent_udf(cql): grant(cql, 'EXECUTE', f'ALL FUNCTIONS IN KEYSPACE {keyspace}', username) with pytest.raises((InvalidRequest, ConfigurationException)): grant(cql, 'EXECUTE', f'FUNCTION {keyspace}.{fun_name}(int)', username) - cql.execute(f"CREATE KEYSPACE IF NOT EXISTS {keyspace} WITH REPLICATION = {{ 'class' : 'SimpleStrategy', 'replication_factor' : 1 }}") + cql.execute(f"CREATE KEYSPACE IF NOT EXISTS {keyspace} WITH REPLICATION = {{ 'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 }}") grant(cql, 'EXECUTE', f'ALL FUNCTIONS IN KEYSPACE {keyspace}', username) revoke(cql, 'EXECUTE', f'ALL FUNCTIONS IN KEYSPACE {keyspace}', username) with pytest.raises((InvalidRequest, SyntaxException)): @@ -316,7 +316,7 @@ def test_grant_perms_on_nonexistent_udf(cql): # Test that permissions for user-defined aggregates are also enforced. def test_grant_revoke_uda_permissions(cql): schema = 'id bigint primary key' - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: with new_test_table(cql, keyspace, schema) as table: for i in range(8): cql.execute(f"INSERT INTO {table} (id) VALUES ({10**i})") @@ -375,7 +375,7 @@ def test_grant_revoke_uda_permissions(cql): # Test that permissions for user-defined functions created on top of user-defined types work def test_udf_permissions_with_udt(cql): - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: with new_type(cql, keyspace, '(v int)') as udt: schema = f"a frozen<{udt}> primary key" with new_test_table(cql, keyspace, schema) as table: @@ -397,7 +397,7 @@ def test_udf_permissions_with_udt(cql): # Test that permissions on user-defined functions with no arguments work def test_udf_permissions_no_args(cql): - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: with new_test_table(cql, keyspace, schema="a int primary key") as table, new_user(cql) as username: with new_session(cql, username) as user_session: fun_body_lua = f"() CALLED ON NULL INPUT RETURNS int LANGUAGE lua AS 'return 42;'" @@ -423,7 +423,7 @@ def test_udf_permissions_no_args(cql): def test_create_on_single_function(cql): schema = "a int primary key" user = "cassandra" - with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 1 }") as keyspace: + with new_test_keyspace(cql, "WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 1 }") as keyspace: with new_test_table(cql, keyspace, schema) as table: fun_body_lua = f"(a int, b int) CALLED ON NULL INPUT RETURNS int LANGUAGE lua AS 'return a + b;'" fun_body_java = f"(a int, b int) CALLED ON NULL INPUT RETURNS int LANGUAGE java AS 'return a + b;'" diff --git a/test/cql-pytest/test_uda.py b/test/cql-pytest/test_uda.py index 90bdd5aed5..26349b3175 100644 --- a/test/cql-pytest/test_uda.py +++ b/test/cql-pytest/test_uda.py @@ -217,7 +217,7 @@ def test_nested_collection_initcond(scylla_only, cql, test_keyspace): def test_drop_keyspace_with_uda(scylla_only, cql): ks = unique_name() - cql.execute(f"CREATE KEYSPACE {ks} WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}") + cql.execute(f"CREATE KEYSPACE {ks} WITH replication = {{'class': 'NetworkTopologyStrategy', 'replication_factor': '1'}}") f1 = unique_name() cql.execute(f"CREATE FUNCTION {ks}.{f1}(acc int, val int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE lua AS $$ return acc $$") f2 = unique_name() diff --git a/test/cql/cassandra_batch_test.cql b/test/cql/cassandra_batch_test.cql index 72c5240fd1..5279a1aa0d 100644 --- a/test/cql/cassandra_batch_test.cql +++ b/test/cql/cassandra_batch_test.cql @@ -12,7 +12,7 @@ -- SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0) -- setup -CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE k WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; USE k; -- testBatch diff --git a/test/cql/cassandra_batch_test.result b/test/cql/cassandra_batch_test.result index e102d85ead..cdf7298d47 100644 --- a/test/cql/cassandra_batch_test.result +++ b/test/cql/cassandra_batch_test.result @@ -12,7 +12,7 @@ > -- SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0) > > -- setup -> CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE k WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > USE k; OK diff --git a/test/cql/cdc_allow_dropping_manually_created_log_test.cql b/test/cql/cdc_allow_dropping_manually_created_log_test.cql index 7ca04c98dd..5379b5af18 100644 --- a/test/cql/cdc_allow_dropping_manually_created_log_test.cql +++ b/test/cql/cdc_allow_dropping_manually_created_log_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; create table ks.test_scylla_cdc_log (pk int primary key); -- Should be possible to drop it drop table ks.test_scylla_cdc_log; diff --git a/test/cql/cdc_allow_dropping_manually_created_log_test.result b/test/cql/cdc_allow_dropping_manually_created_log_test.result index 213f08109d..4b8d9aa051 100644 --- a/test/cql/cdc_allow_dropping_manually_created_log_test.result +++ b/test/cql/cdc_allow_dropping_manually_created_log_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > create table ks.test_scylla_cdc_log (pk int primary key); OK diff --git a/test/cql/cdc_batch_delete_postimage_test.cql b/test/cql/cdc_batch_delete_postimage_test.cql index 733b7fae61..c30625e1ee 100644 --- a/test/cql/cdc_batch_delete_postimage_test.cql +++ b/test/cql/cdc_batch_delete_postimage_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; -- do range delete in batch create table ks.t (pk int, ck int, v int, primary key(pk, ck)) with cdc = {'enabled': true, 'preimage': true, 'postimage': true}; diff --git a/test/cql/cdc_batch_delete_postimage_test.result b/test/cql/cdc_batch_delete_postimage_test.result index db6ef276d1..dbd6afe784 100644 --- a/test/cql/cdc_batch_delete_postimage_test.result +++ b/test/cql/cdc_batch_delete_postimage_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > -- do range delete in batch > create table ks.t (pk int, ck int, v int, primary key(pk, ck)) with cdc = {'enabled': true, 'preimage': true, 'postimage': true}; diff --git a/test/cql/cdc_disallow_cdc_for_counters_test.cql b/test/cql/cdc_disallow_cdc_for_counters_test.cql index 6997f272b2..a93afabdfb 100644 --- a/test/cql/cdc_disallow_cdc_for_counters_test.cql +++ b/test/cql/cdc_disallow_cdc_for_counters_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; create table ks.tb1 (pk int primary key, c1 counter) with cdc = {'enabled': true}; create table ks.tb2 (pk int primary key, c1 counter); diff --git a/test/cql/cdc_disallow_cdc_for_counters_test.result b/test/cql/cdc_disallow_cdc_for_counters_test.result index 60061c5055..03419f0942 100644 --- a/test/cql/cdc_disallow_cdc_for_counters_test.result +++ b/test/cql/cdc_disallow_cdc_for_counters_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > create table ks.tb1 (pk int primary key, c1 counter) with cdc = {'enabled': true}; Error from server: code=2200 [Invalid query] message="Cannot create CDC log for table ks.tb1. Counter support not implemented" diff --git a/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.cql b/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.cql index 28df43c9b0..daccf7abf0 100644 --- a/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.cql +++ b/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; create table ks.tb1 (pk int primary key, v int) with cdc = {'enabled': true}; create materialized view ks.tb1_mv as select * from ks.tb1_scylla_cdc_log where v is not null primary key (v); diff --git a/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.result b/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.result index a314d58519..85ee3084e6 100644 --- a/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.result +++ b/test/cql/cdc_disallow_materialized_view_for_cdc_log_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > create table ks.tb1 (pk int primary key, v int) with cdc = {'enabled': true}; OK diff --git a/test/cql/cdc_disallow_nested_cdc_logs_test.cql b/test/cql/cdc_disallow_nested_cdc_logs_test.cql index 6238574795..43e0cb7082 100644 --- a/test/cql/cdc_disallow_nested_cdc_logs_test.cql +++ b/test/cql/cdc_disallow_nested_cdc_logs_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; create table ks.tbl (pk int primary key) with cdc = {'enabled': true}; alter table ks.tbl_scylla_cdc_log with cdc = {'enabled': true}; DROP KEYSPACE ks; diff --git a/test/cql/cdc_disallow_nested_cdc_logs_test.result b/test/cql/cdc_disallow_nested_cdc_logs_test.result index 50213451f7..ce7576824d 100644 --- a/test/cql/cdc_disallow_nested_cdc_logs_test.result +++ b/test/cql/cdc_disallow_nested_cdc_logs_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > create table ks.tbl (pk int primary key) with cdc = {'enabled': true}; OK diff --git a/test/cql/cdc_enable_disable_test.cql b/test/cql/cdc_enable_disable_test.cql index 980ae55882..820bb63d4f 100644 --- a/test/cql/cdc_enable_disable_test.cql +++ b/test/cql/cdc_enable_disable_test.cql @@ -2,7 +2,7 @@ -- do not depend on how stream IDs are assigned to partition keys. -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; -- create cdc enabled table create table ks.t (pk int, ck int, v int, primary key(pk, ck)) with cdc = {'enabled': true}; diff --git a/test/cql/cdc_enable_disable_test.result b/test/cql/cdc_enable_disable_test.result index 4637082840..7c7831e7d1 100644 --- a/test/cql/cdc_enable_disable_test.result +++ b/test/cql/cdc_enable_disable_test.result @@ -2,7 +2,7 @@ > -- do not depend on how stream IDs are assigned to partition keys. > > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > > -- create cdc enabled table diff --git a/test/cql/cdc_static_and_clustered_rows_test.cql b/test/cql/cdc_static_and_clustered_rows_test.cql index 635b6ac212..1e7b0082c0 100644 --- a/test/cql/cdc_static_and_clustered_rows_test.cql +++ b/test/cql/cdc_static_and_clustered_rows_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; create table ks.t (pk int, ck int, vs int static, vc int, primary key (pk, ck)) with cdc = {'enabled': true, 'preimage': true}; -- generates 2 rows: preimage(static), delta(static) diff --git a/test/cql/cdc_static_and_clustered_rows_test.result b/test/cql/cdc_static_and_clustered_rows_test.result index bf2ecc556c..63521923b9 100644 --- a/test/cql/cdc_static_and_clustered_rows_test.result +++ b/test/cql/cdc_static_and_clustered_rows_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > create table ks.t (pk int, ck int, vs int static, vc int, primary key (pk, ck)) with cdc = {'enabled': true, 'preimage': true}; OK diff --git a/test/cql/cdc_with_lwt_test.cql b/test/cql/cdc_with_lwt_test.cql index f9f161f5ed..ebe13f7c7a 100644 --- a/test/cql/cdc_with_lwt_test.cql +++ b/test/cql/cdc_with_lwt_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; CREATE TABLE ks.tbl_cdc_lwt (pk int, ck int, val int, PRIMARY KEY(pk, ck)) WITH cdc = {'enabled':true, 'preimage':true}; -- (0) successful insert diff --git a/test/cql/cdc_with_lwt_test.result b/test/cql/cdc_with_lwt_test.result index 2f3ea3c83f..8c0b51a628 100644 --- a/test/cql/cdc_with_lwt_test.result +++ b/test/cql/cdc_with_lwt_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > CREATE TABLE ks.tbl_cdc_lwt (pk int, ck int, val int, PRIMARY KEY(pk, ck)) WITH cdc = {'enabled':true, 'preimage':true}; OK diff --git a/test/cql/counters_test.cql b/test/cql/counters_test.cql index 0c26d60a17..b30034cebe 100644 --- a/test/cql/counters_test.cql +++ b/test/cql/counters_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; CREATE TABLE ks.tbl_cnt (pk int PRIMARY KEY, c1 counter); -- insert some values in one column diff --git a/test/cql/counters_test.result b/test/cql/counters_test.result index d42a9b0fcf..1898819149 100644 --- a/test/cql/counters_test.result +++ b/test/cql/counters_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > CREATE TABLE ks.tbl_cnt (pk int PRIMARY KEY, c1 counter); OK diff --git a/test/cql/forbid_adding_to_udt_used_in_partkey_test.cql b/test/cql/forbid_adding_to_udt_used_in_partkey_test.cql index e47a239fb3..7fcf1cf3ca 100644 --- a/test/cql/forbid_adding_to_udt_used_in_partkey_test.cql +++ b/test/cql/forbid_adding_to_udt_used_in_partkey_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; create type ks.ut (a int); create table ks.t (pk frozen primary key); alter type ks.ut add b int; diff --git a/test/cql/forbid_adding_to_udt_used_in_partkey_test.result b/test/cql/forbid_adding_to_udt_used_in_partkey_test.result index 4aa7896481..0e8da48119 100644 --- a/test/cql/forbid_adding_to_udt_used_in_partkey_test.result +++ b/test/cql/forbid_adding_to_udt_used_in_partkey_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > create type ks.ut (a int); OK diff --git a/test/cql/lua_test.cql b/test/cql/lua_test.cql index bb28799178..410e85aa2e 100644 --- a/test/cql/lua_test.cql +++ b/test/cql/lua_test.cql @@ -1,5 +1,5 @@ -- Error messages contain a keyspace name. Make the output stable. -CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; -- setup create table ks.my_table (key int primary key); insert into ks.my_table (key) values (1); diff --git a/test/cql/lua_test.result b/test/cql/lua_test.result index c0add80827..04d314fff4 100644 --- a/test/cql/lua_test.result +++ b/test/cql/lua_test.result @@ -1,5 +1,5 @@ > -- Error messages contain a keyspace name. Make the output stable. -> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > -- setup > create table ks.my_table (key int primary key); diff --git a/test/cql/lwt_batch_validation_test.cql b/test/cql/lwt_batch_validation_test.cql index bd9c1b5302..7456a39190 100644 --- a/test/cql/lwt_batch_validation_test.cql +++ b/test/cql/lwt_batch_validation_test.cql @@ -1,4 +1,4 @@ -CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE k WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; USE k; CREATE TABLE t1 (userid int PRIMARY KEY); CREATE TABLE t2 (userid int PRIMARY KEY); diff --git a/test/cql/lwt_batch_validation_test.result b/test/cql/lwt_batch_validation_test.result index 4c83d3b157..12cc57944c 100644 --- a/test/cql/lwt_batch_validation_test.result +++ b/test/cql/lwt_batch_validation_test.result @@ -1,4 +1,4 @@ -> CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE k WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > USE k; OK diff --git a/test/cql/token_from_null_test.cql b/test/cql/token_from_null_test.cql index 744b6501a8..1c4039cd7b 100644 --- a/test/cql/token_from_null_test.cql +++ b/test/cql/token_from_null_test.cql @@ -1,5 +1,5 @@ -- single null value -CREATE KEYSPACE reproducer WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE reproducer WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; CREATE TABLE reproducer.t(pk int PRIMARY KEY, v int); INSERT INTO reproducer.t (pk) VALUES (1); SELECT TOKEN(v) FROM reproducer.t; diff --git a/test/cql/token_from_null_test.result b/test/cql/token_from_null_test.result index 6ce2dd8d3f..9db5c14fbd 100644 --- a/test/cql/token_from_null_test.result +++ b/test/cql/token_from_null_test.result @@ -1,5 +1,5 @@ > -- single null value -> CREATE KEYSPACE reproducer WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE reproducer WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > CREATE TABLE reproducer.t(pk int PRIMARY KEY, v int); OK diff --git a/test/cql/varchar_as_table_name_test.cql b/test/cql/varchar_as_table_name_test.cql index 3d410460c1..7694247c37 100644 --- a/test/cql/varchar_as_table_name_test.cql +++ b/test/cql/varchar_as_table_name_test.cql @@ -1,5 +1,5 @@ -- regression test for #10642 -CREATE KEYSPACE reproducer WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +CREATE KEYSPACE reproducer WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; CREATE TABLE reproducer.varchar(pk int, ck int, PRIMARY KEY(pk, ck)); CREATE TABLE reproducer.text(pk int, ck int, PRIMARY KEY(pk, ck)); DROP KEYSPACE reproducer; diff --git a/test/cql/varchar_as_table_name_test.result b/test/cql/varchar_as_table_name_test.result index 46b28a4432..2aebda4c3c 100644 --- a/test/cql/varchar_as_table_name_test.result +++ b/test/cql/varchar_as_table_name_test.result @@ -1,5 +1,5 @@ > -- regression test for #10642 -> CREATE KEYSPACE reproducer WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; +> CREATE KEYSPACE reproducer WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; OK > CREATE TABLE reproducer.varchar(pk int, ck int, PRIMARY KEY(pk, ck)); OK diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index b72c94c336..64ce79c1b0 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -465,7 +465,7 @@ public: } future<> create_keyspace(std::string_view name) { - auto query = format("create keyspace {} with replication = {{ 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor' : 1 }};", name); + auto query = format("create keyspace {} with replication = {{ 'class' : 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'replication_factor' : 1 }};", name); return execute_cql(query).discard_result(); } diff --git a/test/object_store/run b/test/object_store/run index 59ebf9c69c..84da7d23d7 100755 --- a/test/object_store/run +++ b/test/object_store/run @@ -61,7 +61,7 @@ run.wait_for_services(pid, [ lambda: check_cql(ip) ]) print(f'Create keyspace (minio listening at {s3_server_address})') cluster = run.get_cql_cluster(ip) conn = cluster.connect() -conn.execute("CREATE KEYSPACE test_ks WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': '1' } AND STORAGE = { 'type': 'S3', 'endpoint': '" + f'{s3_server_address}' + "', 'bucket': '" + f'{s3_public_bucket}' + "' };") +conn.execute("CREATE KEYSPACE test_ks WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'replication_factor': '1' } AND STORAGE = { 'type': 'S3', 'endpoint': '" + f'{s3_server_address}' + "', 'bucket': '" + f'{s3_public_bucket}' + "' };") conn.execute("CREATE TABLE test_ks.test_cf ( name text primary key, value text );") conn.execute("INSERT INTO test_ks.test_cf ( name, value ) VALUES ('0', 'zero');") conn.execute("INSERT INTO test_ks.test_cf ( name, value ) VALUES ('1', 'one');") diff --git a/test/perf/perf_fast_forward.cc b/test/perf/perf_fast_forward.cc index 85f3800e31..e3a0b8a4f3 100644 --- a/test/perf/perf_fast_forward.cc +++ b/test/perf/perf_fast_forward.cc @@ -1743,7 +1743,7 @@ static void populate(const std::vector& datasets, cql_test_env& env, const table_config& cfg, size_t flush_threshold) { drop_keyspace_if_exists(env, "ks"); - env.execute_cql("CREATE KEYSPACE ks WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};").get(); + env.execute_cql("CREATE KEYSPACE ks WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};").get(); std::cout << "Saving test config...\n"; env.execute_cql("create table config (name text primary key, n_rows int, value_size int)").get(); diff --git a/test/pylib/scylla_cluster.py b/test/pylib/scylla_cluster.py index 461c336c95..251bc5c00e 100644 --- a/test/pylib/scylla_cluster.py +++ b/test/pylib/scylla_cluster.py @@ -458,7 +458,7 @@ class ScyllaServer: ) as cluster: with cluster.connect() as session: session.execute("CREATE KEYSPACE IF NOT EXISTS k WITH REPLICATION = {" + - "'class' : 'SimpleStrategy', 'replication_factor' : 1 }") + "'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1 }") session.execute("DROP KEYSPACE k") async def shutdown_control_connection(self) -> None: