Skip to content

Commit

Permalink
ovn: check whether db file is fixed (#3928)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
  • Loading branch information
zhangzujian committed Apr 17, 2024
1 parent da69a41 commit cdd65b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dist/images/start-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ function ovn_db_pre_start() {
cp "$db_file" "$db_bak" || return 1

echo "detected database corruption for file $db_file, try to fix it."
ovsdb-tool fix-cluster "$db_file" && return
if ovsdb-tool fix-cluster "$db_file"; then
echo "checking whether database file $db_file has been fixed."
if ovsdb-tool check-cluster "$db_file"; then
return
fi
fi

echo "failed to fix database file $db_file, rebuild it."
local sid=$(ovsdb-tool db-sid "$db_file")
Expand Down

0 comments on commit cdd65b5

Please sign in to comment.