Skip to content

Commit

Permalink
fix:slots rebalance error and replication stats error when use pika o… (
Browse files Browse the repository at this point in the history
OpenAtomFoundation#2651)

* fix:slots rebalance error and replication stats error when use pika operater

* Update replication_test.go

---------

Co-authored-by: chejinge <[email protected]>
  • Loading branch information
2 people authored and chenbt-hz committed Jun 3, 2024
1 parent d5655d9 commit 9147586
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tools/kubeblocks_helm/installdebug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# helm install pika ./pika && helm install pika-cluster ./pika-cluster

helm template pika ./pika --output-dir ./output/pika
#helm template pika-cluster ./pika-cluster --output-dir ./output/pika-cluster
12 changes: 11 additions & 1 deletion tools/kubeblocks_helm/pika/script/admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ wait_master_registered() {
done
}

wait_all_master_registered() {
for ((group_id = 1; group_id <= GROUP_ID; group_id++)); do
until $CODIS_ADMIN --list-group | jq -r '.[] | select(.id == '${group_id}') | .servers[] | select(.role == "master") | .server'; do
echo "Waiting for master to be registered in group $group_id"
sleep 2
done
done
}

# confirm group has the max index of all groups
confirm_max_group() {
max_group_id=0
Expand Down Expand Up @@ -72,7 +81,7 @@ reload_until_success() {

register_server() {
reload_until_success
if [ ${POD_ID} -gt 0 ]; then wait_master_registered; fi
if [ ${POD_ID} -gt 0 ]; then wait_all_master_registered; fi
$CODIS_ADMIN --create-group --gid=${GROUP_ID} 1>/dev/null 2>&1
$CODIS_ADMIN --group-add --gid=${GROUP_ID} --addr=${KB_POD_FQDN}:9221
$CODIS_ADMIN --sync-action --create --addr=${KB_POD_FQDN}:9221 1>/dev/null 2>&1
Expand Down Expand Up @@ -123,6 +132,7 @@ if [ $# -eq 1 ]; then
wait_dashboard_running
confirm_max_group
wait_master_registered
wait_all_master_registered
rebalance
exit 0
;;
Expand Down
3 changes: 3 additions & 0 deletions tools/kubeblocks_helm/reinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
helm uninstall pika && helm uninstall pika-cluster
sleep 5
helm install pika ./pika && helm install pika-cluster ./pika-cluster

0 comments on commit 9147586

Please sign in to comment.