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

ovn: check whether db file is fixed #3928

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
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
9 changes: 8 additions & 1 deletion dist/images/start-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,14 @@ function ovn_db_pre_start() {
cp "$db_file" "$db_bak" || return 1

echo "detected database corruption for file $db_file, try to fix it."
if ! ovsdb-tool fix-cluster "$db_file"; then
local fixed=0
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
fixed=1
fi
fi
if [ $fixed -ne 1 ]; then
echo "failed to fix database file $db_file, rebuild it."
local sid=$(ovsdb-tool db-sid "$db_file")
if ! echo -n "$sid" | grep -qE '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'; then
Expand Down
Loading