From 98d784eba3506478481d5a22edbee6ca0bdb68da Mon Sep 17 00:00:00 2001 From: Zhe Huang Date: Thu, 16 Apr 2020 17:21:07 -0400 Subject: [PATCH] Fix the bug of failure to write due to not sufficient good replicas in SA DBAAS Signed-off-by: Zhe Huang Change-Id: I354562c1c3cdc41073d887fb22226e54455a5941 --- helm/dbaas/templates/configmap.yaml | 8 +++++++- helm/dbaas/values.yaml | 8 ++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/helm/dbaas/templates/configmap.yaml b/helm/dbaas/templates/configmap.yaml index 9f82b13..a9a0764 100644 --- a/helm/dbaas/templates/configmap.yaml +++ b/helm/dbaas/templates/configmap.yaml @@ -27,9 +27,15 @@ metadata: data: redis.conf: | dir "/data" - {{- range $key, $value := .Values.dbaas.redis.config }} +{{- if $.Values.dbaas.enableHighAvailability }} + {{- range $key, $value := .Values.dbaas.redis.ha_config }} + {{ $key }} {{ $value }} + {{- end }} +{{- else }} + {{- range $key, $value := .Values.dbaas.redis.sa_config }} {{ $key }} {{ $value }} {{- end }} +{{- end }} {{- if $.Values.dbaas.enableHighAvailability }} sentinel.conf: | diff --git a/helm/dbaas/values.yaml b/helm/dbaas/values.yaml index c81ef98..7a5d1ae 100644 --- a/helm/dbaas/values.yaml +++ b/helm/dbaas/values.yaml @@ -27,7 +27,12 @@ dbaas: redis: masterGroupName: dbaasmaster - config: + sa_config: + ## For /data/conf/redis.conf + protected-mode: "no" + loadmodule: "/usr/local/libexec/redismodule/libredismodule.so" + bind: 0.0.0.0 + ha_config: ## For /data/conf/redis.conf min-slaves-to-write: 1 min-slaves-max-lag: 5 @@ -35,7 +40,6 @@ dbaas: maxmemory-policy: "volatile-lru" protected-mode: "no" loadmodule: "/usr/local/libexec/redismodule/libredismodule.so" - bind: 0.0.0.0 sentinel: quorum: 2 -- 2.16.6