Skip to content

Commit 006b4a8

Browse files
cjc7373apecloud-bot
authored andcommitted
fix(pulsar): bookie failed to start (#2551)
Co-authored-by: cjc7373 <cjc7373@users.noreply.github.com> (cherry picked from commit 862bca8)
1 parent 9228fed commit 006b4a8

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ KubeBlocks add-ons.
2121
| minio | minio-2024.6.29<br>minio-2025.10.15 | High Performance, Kubernetes Native Object Storage | ldming |
2222
| mogdb | mogdb-5.0.5 | A Helm chart for Kubernetes | yabinji shanshanying |
2323
| mongodb | mongodb-4.0.28<br>mongodb-4.4.29<br>mongodb-5.0.29<br>mongodb-6.0.27<br>mongodb-7.0.28<br>mongodb-8.0.17<br>mongodb-shard-4.0.28<br>mongodb-shard-4.4.29<br>mongodb-shard-5.0.29<br>mongodb-shard-6.0.27<br>mongodb-shard-7.0.28<br>mongodb-shard-8.0.17<br>mongos-4.0.28<br>mongos-4.4.29<br>mongos-5.0.29<br>mongos-6.0.27<br>mongos-7.0.28<br>mongos-8.0.17 | MongoDB is a document database designed for ease of application development and scaling. | xuriwuyun |
24-
| mysql | mysql-5.7.44<br>mysql-8.0.33<br>mysql-8.0.34<br>mysql-8.0.35<br>mysql-8.0.36<br>mysql-8.0.37<br>mysql-8.0.38<br>mysql-8.0.39<br>mysql-8.0.41<br>mysql-8.0.44<br>mysql-8.4.0<br>mysql-8.4.1<br>mysql-8.4.2<br>mysql-8.4.3<br>mysql-8.4.7<br>mysql-mgr-8.0.33<br>mysql-mgr-8.0.34<br>mysql-mgr-8.0.35<br>mysql-mgr-8.0.36<br>mysql-mgr-8.0.37<br>mysql-mgr-8.0.38<br>mysql-mgr-8.0.39<br>mysql-mgr-8.4.0<br>mysql-mgr-8.4.1<br>mysql-mgr-8.4.2<br>mysql-orc-5.7.44<br>mysql-orc-8.0.33<br>mysql-orc-8.0.34<br>mysql-orc-8.0.35<br>mysql-orc-8.0.36<br>mysql-orc-8.0.37<br>mysql-orc-8.0.38<br>mysql-orc-8.0.39<br>mysql-proxysql-2.4.4 | MySQL is a widely used, open-source relational database management system (RDBMS) | xuriwuyun |
24+
| mysql | mysql-5.7.44<br>mysql-8.0.33<br>mysql-8.0.34<br>mysql-8.0.35<br>mysql-8.0.36<br>mysql-8.0.37<br>mysql-8.0.38<br>mysql-8.0.39<br>mysql-8.0.41<br>mysql-8.0.44<br>mysql-8.4.0<br>mysql-8.4.1<br>mysql-8.4.2<br>mysql-8.4.3<br>mysql-8.4.4<br>mysql-8.4.5<br>mysql-8.4.6<br>mysql-8.4.7<br>mysql-8.4.8<br>mysql-mgr-8.0.33<br>mysql-mgr-8.0.34<br>mysql-mgr-8.0.35<br>mysql-mgr-8.0.36<br>mysql-mgr-8.0.37<br>mysql-mgr-8.0.38<br>mysql-mgr-8.0.39<br>mysql-mgr-8.4.0<br>mysql-mgr-8.4.1<br>mysql-mgr-8.4.2<br>mysql-orc-5.7.44<br>mysql-orc-8.0.33<br>mysql-orc-8.0.34<br>mysql-orc-8.0.35<br>mysql-orc-8.0.36<br>mysql-orc-8.0.37<br>mysql-orc-8.0.38<br>mysql-orc-8.0.39<br>mysql-proxysql-2.4.4 | MySQL is a widely used, open-source relational database management system (RDBMS) | xuriwuyun |
2525
| nebula | nebula-v3.5.0<br>nebula-v3.8.0 | NebulaGraph is a popular open-source graph database that can handle large volumes of data with milliseconds of latency, scale up quickly, and have the ability to perform fast graph analytics. | shanshanying Xuntao Cheng |
2626
| neo4j | neo4j-4.4.42<br>neo4j-5.26.5 | Neo4j is a highly scalable, robust native graph database. | xuriwuyun |
2727
| neon | neon-broker-1.0.0<br>neon-compute-1.0.0<br>neon-pageserver-1.0.0<br>neon-safekeeper-1.0.0 | Neon is a serverless open-source alternative to AWS Aurora Postgres. It separates storage and compute and substitutes the PostgreSQL storage layer by redistributing data across a cluster of nodes. | ApeCloud |

addons/pulsar/scripts/init-bookies.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
#!/bin/bash
22

3-
# shellcheck disable=SC2034
4-
ut_mode="false"
5-
test || __() {
6-
# when running in non-unit test mode, set the options "set -ex".
7-
set -ex;
8-
}
9-
103
wait_for_zookeeper() {
114
local zk_servers="$1"
12-
local zk_domain="${zk_servers%%:*}"
13-
local zk_port="2181"
14-
155
echo "Waiting for Zookeeper at ${zk_servers} to be ready..."
166
until zkURL=${zk_servers} python3 /kb-scripts/zookeeper.py get /; do
177
sleep 1
@@ -60,7 +50,17 @@ decommission_old_bookie() {
6050
echo "Data dir is empty"
6151
fqdn=$(echo "$BOOKKEEPER_POD_FQDN_LIST" | tr ',' '\n' | grep "$CURRENT_POD_NAME")
6252
echo "Decommissioning old bookie with id $fqdn"
63-
bin/bookkeeper shell decommissionbookie -bookieid "$fqdn:3181"
53+
if ! bin/bookkeeper shell decommissionbookie -bookieid "$fqdn:3181" | tee /tmp/decommission.log; then
54+
# shellcheck disable=SC2016
55+
if cat /tmp/decommission.log | grep -q 'org.apache.zookeeper.KeeperException$NoNodeException'; then
56+
echo "Bookie $fqdn is not registered in zookeeper, skip decommission"
57+
else
58+
echo "Failed to decommission bookie $fqdn"
59+
exit 1
60+
fi
61+
else
62+
echo "Bookie $fqdn decommissioned successfully"
63+
fi
6464
fi
6565
}
6666

@@ -93,5 +93,7 @@ init_bookies() {
9393
# end here. The script path is assigned to the __SOURCED__ variable.
9494
${__SOURCED__:+false} : || return 0
9595

96+
set -exo pipefail;
97+
9698
# main
9799
init_bookies

0 commit comments

Comments
 (0)