storage_service: introduce CORRECT_COUNTER_ORDER feature

Scylla 1.7.4 used incorrect ordering of counter shards. In order to fix
this problem a new feature is introduced that will be used to determine
when nodes with that bug fixed can start sending counter shard in the
correct order.
This commit is contained in:
Paweł Dziepak
2017-09-01 09:55:02 +01:00
parent 1e03c4acbe
commit ecd2bf128b
2 changed files with 9 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ static const sstring MATERIALIZED_VIEWS_FEATURE = "MATERIALIZED_VIEWS";
static const sstring COUNTERS_FEATURE = "COUNTERS";
static const sstring INDEXES_FEATURE = "INDEXES";
static const sstring DIGEST_MULTIPARTITION_READ_FEATURE = "DIGEST_MULTIPARTITION_READ";
static const sstring CORRECT_COUNTER_ORDER_FEATURE = "CORRECT_COUNTER_ORDER";
distributed<storage_service> _the_storage_service;
@@ -127,6 +128,7 @@ sstring storage_service::get_config_supported_features() {
LARGE_PARTITIONS_FEATURE,
COUNTERS_FEATURE,
DIGEST_MULTIPARTITION_READ_FEATURE,
CORRECT_COUNTER_ORDER_FEATURE,
};
if (service::get_local_storage_service()._db.local().get_config().experimental()) {
features.push_back(MATERIALIZED_VIEWS_FEATURE);
@@ -1352,6 +1354,7 @@ future<> storage_service::init_server(int delay) {
ss._large_partitions_feature = gms::feature(LARGE_PARTITIONS_FEATURE);
ss._counters_feature = gms::feature(COUNTERS_FEATURE);
ss._digest_multipartition_read_feature = gms::feature(DIGEST_MULTIPARTITION_READ_FEATURE);
ss._correct_counter_order_feature = gms::feature(CORRECT_COUNTER_ORDER_FEATURE);
if (ss._db.local().get_config().experimental()) {
ss._materialized_views_feature = gms::feature(MATERIALIZED_VIEWS_FEATURE);

View File

@@ -264,7 +264,7 @@ private:
gms::feature _counters_feature;
gms::feature _indexes_feature;
gms::feature _digest_multipartition_read_feature;
gms::feature _correct_counter_order_feature;
public:
void enable_all_features() {
_range_tombstones_feature.enable();
@@ -273,6 +273,7 @@ public:
_counters_feature.enable();
_indexes_feature.enable();
_digest_multipartition_read_feature.enable();
_correct_counter_order_feature.enable();
}
void finish_bootstrapping() {
@@ -2242,6 +2243,10 @@ public:
bool cluster_supports_digest_multipartition_reads() const {
return bool(_digest_multipartition_read_feature);
}
bool cluster_supports_correct_counter_order() const {
return bool(_correct_counter_order_feature);
}
};
inline future<> init_storage_service(distributed<database>& db) {