features: add PER_TABLE_PARTITIONERS feature
This new feature is required because we now allow setting partitioner per table. This will influence the digest of table schema so we must not include partitioner name into the digest unless we know that the whole cluster already supports per table partitioners. Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This commit is contained in:
@@ -137,6 +137,7 @@ extern const std::string_view CDC;
|
||||
extern const std::string_view NONFROZEN_UDTS;
|
||||
extern const std::string_view HINTED_HANDOFF_SEPARATE_CONNECTION;
|
||||
extern const std::string_view LWT;
|
||||
extern const std::string_view PER_TABLE_PARTITIONERS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ constexpr std::string_view features::CDC = "CDC";
|
||||
constexpr std::string_view features::NONFROZEN_UDTS = "NONFROZEN_UDTS";
|
||||
constexpr std::string_view features::HINTED_HANDOFF_SEPARATE_CONNECTION = "HINTED_HANDOFF_SEPARATE_CONNECTION";
|
||||
constexpr std::string_view features::LWT = "LWT";
|
||||
constexpr std::string_view features::PER_TABLE_PARTITIONERS = "PER_TABLE_PARTITIONERS";
|
||||
|
||||
static logging::logger logger("features");
|
||||
|
||||
@@ -83,7 +84,8 @@ feature_service::feature_service(feature_config cfg) : _config(cfg)
|
||||
, _cdc_feature(*this, features::CDC)
|
||||
, _nonfrozen_udts(*this, features::NONFROZEN_UDTS)
|
||||
, _hinted_handoff_separate_connection(*this, features::HINTED_HANDOFF_SEPARATE_CONNECTION)
|
||||
, _lwt_feature(*this, features::LWT) {
|
||||
, _lwt_feature(*this, features::LWT)
|
||||
, _per_table_partitioners_feature(*this, features::PER_TABLE_PARTITIONERS) {
|
||||
}
|
||||
|
||||
feature_config feature_config_from_db_config(db::config& cfg) {
|
||||
@@ -161,6 +163,7 @@ std::set<std::string_view> feature_service::known_feature_set() {
|
||||
gms::features::NONFROZEN_UDTS,
|
||||
gms::features::UNBOUNDED_RANGE_TOMBSTONES,
|
||||
gms::features::HINTED_HANDOFF_SEPARATE_CONNECTION,
|
||||
gms::features::PER_TABLE_PARTITIONERS,
|
||||
};
|
||||
|
||||
if (_config.enable_sstables_mc_format) {
|
||||
@@ -252,7 +255,8 @@ void feature_service::enable(const std::set<std::string_view>& list) {
|
||||
std::ref(_cdc_feature),
|
||||
std::ref(_nonfrozen_udts),
|
||||
std::ref(_hinted_handoff_separate_connection),
|
||||
std::ref(_lwt_feature)
|
||||
std::ref(_lwt_feature),
|
||||
std::ref(_per_table_partitioners_feature),
|
||||
})
|
||||
{
|
||||
if (list.count(f.name())) {
|
||||
|
||||
@@ -97,6 +97,7 @@ private:
|
||||
gms::feature _nonfrozen_udts;
|
||||
gms::feature _hinted_handoff_separate_connection;
|
||||
gms::feature _lwt_feature;
|
||||
gms::feature _per_table_partitioners_feature;
|
||||
|
||||
public:
|
||||
bool cluster_supports_range_tombstones() const {
|
||||
@@ -167,6 +168,10 @@ public:
|
||||
return _cdc_feature;
|
||||
}
|
||||
|
||||
const feature& cluster_supports_per_table_partitioners() const {
|
||||
return _per_table_partitioners_feature;
|
||||
}
|
||||
|
||||
bool cluster_supports_row_level_repair() const {
|
||||
return bool(_row_level_repair_feature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user