From 9446bf92abcd5790efbb8657e1927010cbad9eb7 Mon Sep 17 00:00:00 2001 From: Maciej Zimnoch Date: Tue, 1 Dec 2020 20:57:58 +0100 Subject: [PATCH] alternator: change default write isolation to only_rmw_uses_lwt "always" is too restrictive and too slow to be a good default. --- pkg/api/v1alpha1/cluster_webhook.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/api/v1alpha1/cluster_webhook.go b/pkg/api/v1alpha1/cluster_webhook.go index 6681c211f5a..46072ca36cf 100644 --- a/pkg/api/v1alpha1/cluster_webhook.go +++ b/pkg/api/v1alpha1/cluster_webhook.go @@ -39,10 +39,16 @@ func (r *ScyllaCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { var _ webhook.Defaulter = &ScyllaCluster{} var _ webhook.Validator = &ScyllaCluster{} +const ( + AlternatorWriteIsolationAlways = "always" + AlternatorWriteIsolationForbidRMW = "forbid_rmw" + AlternatorWriteIsolationOnlyRMWUsesLWT = "only_rmw_uses_lwt" +) + func (c *ScyllaCluster) Default() { if c.Spec.Alternator != nil { if c.Spec.Alternator.WriteIsolation == "" { - c.Spec.Alternator.WriteIsolation = "always" + c.Spec.Alternator.WriteIsolation = AlternatorWriteIsolationOnlyRMWUsesLWT } }