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

fix:slots rebalance error and replication stats error when use pika o… #2651

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion tests/integration/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ var _ = Describe("should replication ", func() {

setkey2 := clientMaster.Set(ctx, "Tnxkey2", "Tnxvalue2", 0)
Expect(setkey2.Err()).NotTo(HaveOccurred())
Expect(get.Val()).To(Equal("QUEUED"))
Expect(setkey2.Val()).To(Equal("QUEUED"))

r2 := clientMaster.Do(ctx, "EXEC")
Expect(r2.Err()).NotTo(HaveOccurred())
Expand Down
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group_id=1 改为 group_id = 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group_id=1 改为 group_id = 1

done

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
Loading