Skip to content

Commit 4a4397c

Browse files
authored
fix recover db failed using offical doc (#2721)
1 parent 786ec73 commit 4a4397c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dist/images/start-db.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ function ovn_db_pre_start() {
118118

119119
local db_file="/etc/ovn/ovn${1}_db.db"
120120
[ ! -e "$db_file" ] && return
121-
ovsdb_tool check-cluster "$db_file" && return
121+
! ovsdb-tool db-is-clustered "$db_file" && return
122+
ovsdb-tool check-cluster "$db_file" && return
122123

123124
echo "detected database corruption for file $db_file, rebuild it."
124125
local sid=$(ovsdb-tool db-sid "$db_file")
@@ -142,7 +143,7 @@ function ovn_db_pre_start() {
142143

143144
local db_new="$db_file.init-$(random_str)"
144145
echo "generating new database file $db_new"
145-
ovsdb_tool --sid $sid join-cluster "$db_new" $db $local_addr ${remote_addr[*]} || return 1
146+
ovsdb-tool --sid $sid join-cluster "$db_new" $db $local_addr ${remote_addr[*]} || return 1
146147

147148
local db_bak="$db_file.backup-$(random_str)"
148149
echo "backup $db_file to $db_bak"

0 commit comments

Comments
 (0)