From 67d8f283aac462eae574f619ef0998a1856eec7a Mon Sep 17 00:00:00 2001 From: Tanguy Ortolo Date: Mon, 6 Nov 2023 16:16:33 +0100 Subject: [PATCH] Use new easyKV etcd option to use serializable reads This is optional, and default to previous behaviour, which is to use linearizable reads. --- pkg/backends/etcd.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/backends/etcd.go b/pkg/backends/etcd.go index 9e469b3..722c995 100644 --- a/pkg/backends/etcd.go +++ b/pkg/backends/etcd.go @@ -44,6 +44,10 @@ type EtcdConfig struct { // The password for the basic_auth authentication. Password string + // Whether to use serializable reads rather than linearizable ones, see + // . + UseSerializableReads bool `toml:"use_serializable_reads"` + // The etcd api-level to use (2 or 3). // // The default is 2. @@ -101,6 +105,7 @@ func (c *EtcdConfig) Connect() (template.Backend, error) { ClientKey: c.ClientKey, ClientCaKeys: c.ClientCaKeys, }), + etcd.WithSerializableReads(c.UseSerializableReads), etcd.WithVersion(c.Version)) if err != nil {