From acb4badbc307d3ccfb7d96313b03f401804f3192 Mon Sep 17 00:00:00 2001 From: Asias He Date: Tue, 26 Feb 2019 12:02:12 +0800 Subject: [PATCH] gossiper: Log feature is enabled only if the feature is not enabled previously We saw the log "Feature FOO is enabled" more than once like below. It is better to log it only when the feature is not enabled previously. gossip - InetAddress 127.0.0.1 is now UP, status = NORMAL gossip - Feature CORRECT_COUNTER_ORDER is enabled gossip - Feature CORRECT_NON_COMPOUND_RANGE_TOMBSTONES is enabled gossip - Feature COUNTERS is enabled gossip - Feature DIGEST_MULTIPARTITION_READ is enabled gossip - Feature INDEXES is enabled gossip - Feature LARGE_PARTITIONS is enabled gossip - Feature LA_SSTABLE_FORMAT is enabled gossip - Feature MATERIALIZED_VIEWS is enabled gossip - Feature MC_SSTABLE_FORMAT is enabled gossip - Feature RANGE_TOMBSTONES is enabled gossip - Feature ROLES is enabled gossip - Feature ROW_LEVEL_REPAIR is enabled gossip - Feature SCHEMA_TABLES_V3 is enabled gossip - Feature STREAM_WITH_RPC_STREAM is enabled gossip - Feature TRUNCATION_TABLE is enabled gossip - Feature WRITE_FAILURE_REPLY is enabled gossip - Feature XXHASH is enabled gossip - Feature CORRECT_COUNTER_ORDER is enabled gossip - Feature CORRECT_NON_COMPOUND_RANGE_TOMBSTONES is enabled gossip - Feature COUNTERS is enabled gossip - Feature DIGEST_MULTIPARTITION_READ is enabled gossip - Feature INDEXES is enabled gossip - Feature LARGE_PARTITIONS is enabled gossip - Feature LA_SSTABLE_FORMAT is enabled gossip - Feature MATERIALIZED_VIEWS is enabled gossip - Feature MC_SSTABLE_FORMAT is enabled gossip - Feature RANGE_TOMBSTONES is enabled gossip - Feature ROLES is enabled gossip - Feature ROW_LEVEL_REPAIR is enabled gossip - Feature SCHEMA_TABLES_V3 is enabled gossip - Feature STREAM_WITH_RPC_STREAM is enabled gossip - Feature TRUNCATION_TABLE is enabled gossip - Feature WRITE_FAILURE_REPLY is enabled gossip - Feature XXHASH is enabled gossip - InetAddress 127.0.0.2 is now UP, status = NORMAL --- gms/gossiper.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gms/gossiper.cc b/gms/gossiper.cc index 9843a91641..dcba80c82c 100644 --- a/gms/gossiper.cc +++ b/gms/gossiper.cc @@ -2242,10 +2242,10 @@ feature& feature::operator=(feature&& other) { } void feature::enable() { - if (engine().cpu_id() == 0) { - logger.info("Feature {} is enabled", name()); - } if (!_enabled) { + if (engine().cpu_id() == 0) { + logger.info("Feature {} is enabled", name()); + } _enabled = true; _pr.set_value(); }