gms: add a cluster feature for fixed hashing
The new hashing routine which properly takes null cells into account is now enabled if the whole cluster is aware of it.
This commit is contained in:
@@ -142,6 +142,7 @@ extern const std::string_view HINTED_HANDOFF_SEPARATE_CONNECTION;
|
||||
extern const std::string_view LWT;
|
||||
extern const std::string_view PER_TABLE_PARTITIONERS;
|
||||
extern const std::string_view PER_TABLE_CACHING;
|
||||
extern const std::string_view DIGEST_FOR_NULL_VALUES;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ constexpr std::string_view features::HINTED_HANDOFF_SEPARATE_CONNECTION = "HINTE
|
||||
constexpr std::string_view features::LWT = "LWT";
|
||||
constexpr std::string_view features::PER_TABLE_PARTITIONERS = "PER_TABLE_PARTITIONERS";
|
||||
constexpr std::string_view features::PER_TABLE_CACHING = "PER_TABLE_CACHING";
|
||||
constexpr std::string_view features::DIGEST_FOR_NULL_VALUES = "DIGEST_FOR_NULL_VALUES";
|
||||
|
||||
static logging::logger logger("features");
|
||||
|
||||
@@ -92,8 +93,9 @@ feature_service::feature_service(feature_config cfg) : _config(cfg)
|
||||
, _hinted_handoff_separate_connection(*this, features::HINTED_HANDOFF_SEPARATE_CONNECTION)
|
||||
, _lwt_feature(*this, features::LWT)
|
||||
, _per_table_partitioners_feature(*this, features::PER_TABLE_PARTITIONERS)
|
||||
, _per_table_caching_feature(*this, features::PER_TABLE_CACHING) {
|
||||
}
|
||||
, _per_table_caching_feature(*this, features::PER_TABLE_CACHING)
|
||||
, _digest_for_null_values_feature(*this, features::DIGEST_FOR_NULL_VALUES)
|
||||
{}
|
||||
|
||||
feature_config feature_config_from_db_config(db::config& cfg, std::set<sstring> disabled) {
|
||||
feature_config fcfg;
|
||||
@@ -190,6 +192,7 @@ std::set<std::string_view> feature_service::known_feature_set() {
|
||||
gms::features::MD_SSTABLE,
|
||||
gms::features::UDF,
|
||||
gms::features::CDC,
|
||||
gms::features::DIGEST_FOR_NULL_VALUES,
|
||||
};
|
||||
|
||||
for (const sstring& s : _config._disabled_features) {
|
||||
@@ -281,6 +284,7 @@ void feature_service::enable(const std::set<std::string_view>& list) {
|
||||
std::ref(_lwt_feature),
|
||||
std::ref(_per_table_partitioners_feature),
|
||||
std::ref(_per_table_caching_feature),
|
||||
std::ref(_digest_for_null_values_feature),
|
||||
})
|
||||
{
|
||||
if (list.contains(f.name())) {
|
||||
|
||||
@@ -104,6 +104,7 @@ private:
|
||||
gms::feature _lwt_feature;
|
||||
gms::feature _per_table_partitioners_feature;
|
||||
gms::feature _per_table_caching_feature;
|
||||
gms::feature _digest_for_null_values_feature;
|
||||
|
||||
public:
|
||||
bool cluster_supports_range_tombstones() const {
|
||||
@@ -182,6 +183,10 @@ public:
|
||||
return _per_table_caching_feature;
|
||||
}
|
||||
|
||||
const feature& cluster_supports_digest_for_null_values() const {
|
||||
return _digest_for_null_values_feature;
|
||||
}
|
||||
|
||||
bool cluster_supports_row_level_repair() const {
|
||||
return bool(_row_level_repair_feature);
|
||||
}
|
||||
|
||||
@@ -124,9 +124,11 @@ using fbu = utils::fb_utilities;
|
||||
|
||||
static inline
|
||||
query::digest_algorithm digest_algorithm(service::storage_proxy& proxy) {
|
||||
return proxy.features().cluster_supports_xxhash_digest_algorithm()
|
||||
? query::digest_algorithm::legacy_xxHash_without_null_digest
|
||||
: query::digest_algorithm::MD5;
|
||||
return proxy.features().cluster_supports_digest_for_null_values()
|
||||
? query::digest_algorithm::xxHash
|
||||
: proxy.features().cluster_supports_xxhash_digest_algorithm()
|
||||
? query::digest_algorithm::legacy_xxHash_without_null_digest
|
||||
: query::digest_algorithm::MD5;
|
||||
}
|
||||
|
||||
static inline
|
||||
|
||||
Reference in New Issue
Block a user