diff --git a/db/system_keyspace.cc b/db/system_keyspace.cc index 7009a95b8f..bd3ab92b4b 100644 --- a/db/system_keyspace.cc +++ b/db/system_keyspace.cc @@ -240,7 +240,9 @@ schema_ptr built_indexes() { {"broadcast_address", inet_addr_type}, {"listen_address", inet_addr_type}, {"supported_features", utf8_type}, - + {"scylla_cpu_sharding_algorithm", utf8_type }, + {"scylla_nr_shards", int32_type }, + {"scylla_msb_ignore", int32_type }, }, // static columns {}, @@ -986,10 +988,15 @@ schema_ptr aggregates() { static future<> setup_version() { return gms::inet_address::lookup(qctx->db().get_config().rpc_address()).then([](gms::inet_address a) { - sstring req = sprint("INSERT INTO system.%s (key, release_version, cql_version, thrift_version, native_protocol_version, data_center, rack, partitioner, rpc_address, broadcast_address, listen_address, supported_features) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" + sstring req = sprint("INSERT INTO system.%s (key, release_version, cql_version, thrift_version, native_protocol_version, data_center, rack, partitioner, rpc_address, broadcast_address, listen_address, supported_features, scylla_cpu_sharding_algorithm, scylla_nr_shards, scylla_msb_ignore) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" , db::system_keyspace::LOCAL); auto& snitch = locator::i_endpoint_snitch::get_local_snitch_ptr(); + int32_t scylla_msb_ignore = + dht::global_partitioner().name() == "org.apache.cassandra.dht.Murmur3Partitioner" + ? (qctx->db().get_config().murmur3_partitioner_ignore_msb_bits()) + : 0; + return execute_cql(req, sstring(db::system_keyspace::LOCAL), version::release(), cql3::query_processor::CQL_VERSION, @@ -1001,7 +1008,10 @@ static future<> setup_version() { a.addr(), utils::fb_utilities::get_broadcast_address().addr(), netw::get_local_messaging_service().listen_address().addr(), - service::storage_service::get_config_supported_features() + service::storage_service::get_config_supported_features(), + dht::global_partitioner().cpu_sharding_algorithm_name(), + int32_t(smp::count), + int32_t(scylla_msb_ignore) ).discard_result(); }); } diff --git a/dht/i_partitioner.hh b/dht/i_partitioner.hh index ded4d08041..0c6efe8bf5 100644 --- a/dht/i_partitioner.hh +++ b/dht/i_partitioner.hh @@ -380,6 +380,10 @@ public: return _shard_count; } + sstring cpu_sharding_algorithm_name() const { + return "biased-token-round-robin"; + } + friend bool operator==(token_view t1, token_view t2); friend bool operator<(token_view t1, token_view t2); friend int tri_compare(token_view t1, token_view t2);