[Feature] Support adding an observer role in FE to improve query load balancing and scale read workloads#734
[Feature] Support adding an observer role in FE to improve query load balancing and scale read workloads#734zhaohehuhu wants to merge 8 commits intoStarRocks:mainfrom
Conversation
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
|
@yandongxiao @kevincai plz help review |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for an Observer role in FE (Frontend) via the Kubernetes Operator to scale read capacity and improve query load balancing. The Observer role is implemented as a configurable field that can be set to specify the number of observer nodes.
Key changes:
- Added
ObserverNumberfield toStarRocksFeSpecAPI with a getter method that defaults to 0 - Exposed observer number as an environment variable (
OBSERVER_NUMBER) to FE pods - Updated CRD schemas to include the new
observerNumberfield - Updated Helm chart values.yaml files with commented examples for the new configuration option
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/starrocks/v1/starrockscluster_types.go | Adds ObserverNumber field to StarRocksFeSpec and implements GetObserverNumber() method with default value of 0 |
| pkg/apis/starrocks/v1/zz_generated.deepcopy.go | Auto-generated deep copy implementation for the new ObserverNumber pointer field |
| pkg/apis/starrocks/v1/labels.go | Adds OBSERVER_NUMBER constant for the environment variable name |
| pkg/apis/starrocks/v1/load_type.go | Minor whitespace cleanup (removed blank lines) |
| pkg/k8sutils/templates/pod/spec.go | Updates Envs function to set OBSERVER_NUMBER environment variable for FE pods using the new field |
| pkg/k8sutils/templates/pod/spec_test.go | Adds test coverage for the OBSERVER_NUMBER environment variable in FE spec |
| config/crd/bases/starrocks.com_starrocksclusters.yaml | Adds observerNumber field definition to the CRD schema |
| deploy/starrocks.com_starrocksclusters.yaml | Adds observerNumber field definition to the deployed CRD schema |
| helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml | Adds commented example for observerNumber configuration |
| helm-charts/charts/kube-starrocks/values.yaml | Adds commented example for observerNumber configuration in parent chart |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
don't try to use FE_OBSERVER_NUMBER to hack the current fe_entry_point.sh It is so dangerous that a single improper env var update can ruin the entire cluster. |
Got it. In that case, we may need to add a new FE observer component. |
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
|
This is much needed, thank you! |
I still need some time to test this feature. Thanks! |
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
|
@kevincai @yandongxiao plz help review. Thanks! |
Description
Support adding a read-only observer role in FE via the K8s Operator to scale read capacity and improve query load balancing.
associated with this PR(StarRocks/starrocks#67778)
Related Issue(s)
No.
Checklist
For operator, please complete the following checklist:
make generateto generate the code.golangci-lint runto check the code style.make testto run UT.make manifeststo update the yaml files of CRD.For helm chart, please complete the following checklist:
file of starrocks chart.
scriptsdirectory, runbash create-parent-chart-values.shto update the values.yaml file of the parentchart( kube-starrocks chart).