From 5b45b0762e022ea2ef747748d14718e65ee9f193 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 28 Jan 2021 11:41:03 +0530 Subject: [PATCH] MM-31993: Add flag to disable gossip compression (#16701) * MM-31993: Add flag to disable gossip compression Load tests have shown that our workload is not very suitable to LZW compression. And in fact, compressing leads to more network bandwidth than less. So we are spending more CPU cycles, and creating more traffic, leading to a lose-lose situation. We add a flag to control this behavior. Ideally, this should not be a flag in the first place, since there is never a need to enable this because clearly there is no benefit. But to keep our community servers working, we need to be able to configure this. https://mattermost.atlassian.net/browse/MM-31993 ```release-notes Add a flag to disable compression in the Gossip protocol. By default the value of the flag is false, which is not the existing default. Therefore, this will cause incompatibility issues during upgrade where servers of different versions are part of the same cluster. It is recommended to completely shutdown a cluster, and then do an upgrade. ``` * flip flag to true * Trigger CI Co-authored-by: Mattermod --- model/config.go | 5 +++++ services/telemetry/telemetry.go | 1 + 2 files changed, 6 insertions(+) diff --git a/model/config.go b/model/config.go index af43745188..11038dfb32 100644 --- a/model/config.go +++ b/model/config.go @@ -814,6 +814,7 @@ type ClusterSettings struct { AdvertiseAddress *string `access:"environment,write_restrictable,cloud_restrictable"` UseIpAddress *bool `access:"environment,write_restrictable,cloud_restrictable"` UseExperimentalGossip *bool `access:"environment,write_restrictable,cloud_restrictable"` + EnableGossipCompression *bool `access:"environment,write_restrictable,cloud_restrictable"` EnableExperimentalGossipEncryption *bool `access:"environment,write_restrictable,cloud_restrictable"` ReadOnlyConfig *bool `access:"environment,write_restrictable,cloud_restrictable"` GossipPort *int `access:"environment,write_restrictable,cloud_restrictable"` @@ -860,6 +861,10 @@ func (s *ClusterSettings) SetDefaults() { s.EnableExperimentalGossipEncryption = NewBool(false) } + if s.EnableGossipCompression == nil { + s.EnableGossipCompression = NewBool(true) + } + if s.ReadOnlyConfig == nil { s.ReadOnlyConfig = NewBool(true) } diff --git a/services/telemetry/telemetry.go b/services/telemetry/telemetry.go index a318914bd0..bea38fbbbe 100644 --- a/services/telemetry/telemetry.go +++ b/services/telemetry/telemetry.go @@ -688,6 +688,7 @@ func (ts *TelemetryService) trackConfig() { "use_ip_address": *cfg.ClusterSettings.UseIpAddress, "use_experimental_gossip": *cfg.ClusterSettings.UseExperimentalGossip, "enable_experimental_gossip_encryption": *cfg.ClusterSettings.EnableExperimentalGossipEncryption, + "enable_gossip_compression": *cfg.ClusterSettings.EnableGossipCompression, "read_only_config": *cfg.ClusterSettings.ReadOnlyConfig, })