Skip to content

Commit

Permalink
Merge pull request #227 from weaviate/add-support-for-metadata-voters
Browse files Browse the repository at this point in the history
Add support for RAFT_METADATA_ONLY_VOTERS setting
  • Loading branch information
antas-marcin committed Apr 25, 2024
2 parents 8b2b1a0 + de1990e commit b215313
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .cicd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ function check_creates_template() {
check_setting_has_value "--set replicas=100" "name: RAFT_JOIN" "value: \"weaviate-0,weaviate-1,weaviate-2,weaviate-3,weaviate-4\""
check_setting_has_value "--set replicas=100" "name: RAFT_BOOTSTRAP_EXPECT" "value: \"5\""

check_setting_has_value "--set replicas=9 --set env.RAFT_METADATA_ONLY_VOTERS=true" "name: RAFT_BOOTSTRAP_EXPECT" "value: \"3\""
check_setting_has_value "--set replicas=9 --set env.RAFT_METADATA_ONLY_VOTERS=true" "name: RAFT_METADATA_ONLY_VOTERS" "value: \"true\""
check_setting_has_value "--set replicas=3 --set env.RAFT_METADATA_ONLY_VOTERS=false" "name: RAFT_BOOTSTRAP_EXPECT" "value: \"3\""

_settingPassageQueryOn="--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.passageQueryServices.passage.enabled=true --set modules.text2vec-transformers.passageQueryServices.query.enabled=true"
check_setting_has_value "$_settingPassageQueryOn" "name: TRANSFORMERS_PASSAGE_INFERENCE_API" "value: http://transformers-inference-passage.default.svc.cluster.local.:8080"
check_setting_has_value "$_settingPassageQueryOn" "name: TRANSFORMERS_QUERY_INFERENCE_API" "value: http://transformers-inference-query.default.svc.cluster.local.:8080"
Expand Down
7 changes: 7 additions & 0 deletions weaviate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ Raft cluster configuration settings
{{- define "raft_configuration" -}}
{{- $replicas := .Values.replicas | int -}}
{{- $voters := .Values.env.RAFT_BOOTSTRAP_EXPECT | int -}}
{{- $metada_only_voters := false -}}
{{- if not (empty .Values.env.RAFT_METADATA_ONLY_VOTERS) -}}
{{- $metada_only_voters = .Values.env.RAFT_METADATA_ONLY_VOTERS -}}
{{- end -}}
{{- if empty .Values.env.RAFT_BOOTSTRAP_EXPECT -}}
{{- if ge $replicas 10 -}}
{{- $voters = 5 -}}
Expand Down Expand Up @@ -216,4 +220,7 @@ Raft cluster configuration settings
- name: RAFT_BOOTSTRAP_EXPECT
value: "{{ $voters }}"
{{- end -}}
{{- if and ($metada_only_voters) (le $replicas $voters) -}}
{{- fail "env.RAFT_METADATA_ONLY_VOTERS is true then .replicas size must be greater than env.RAFT_BOOTSTRAP_EXPECT" -}}
{{- end -}}
{{- end -}}
5 changes: 5 additions & 0 deletions weaviate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ env:
# then RAFT_BOOTSTRAP_EXPECT needs to be equal 2 also.
# RAFT_JOIN: "weaviate-0"

# Set to true if voters nodes should handle only schema. With this setting enabled
# voter nodes will not accept any data, one needs to resize the cluster using replicas
# setting so that replicas > voters.
# RAFT_METADATA_ONLY_VOTERS: false

# The aggressiveness of the Go Garbage Collector. 100 is the default value.
GOGC: 100

Expand Down

0 comments on commit b215313

Please sign in to comment.