Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RAFT_METADATA_ONLY_VOTERS setting #227

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading