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-central: check raft inconsistency from nb/sb logs #3532

Merged
merged 1 commit into from
Dec 16, 2023
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
16 changes: 16 additions & 0 deletions dist/images/ovn-healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,19 @@ if echo ${sb_status} | grep "disconnected" && echo ${sb_role} | grep "candidate"
echo "sb health check failed"
exit 1
fi

set +o pipefail

# check nb/sb log file
function check_log_file() {
local log_file="/var/log/ovn/ovsdb-server-$1.log"
if [ -e $log_file ]; then
if grep -wE '(opened log file)|(does not match prerequisite)' $log_file 2>/dev/null | tail -n 1 | grep 'does not match prerequisite' ; then
echo "raft inconsistency in $1 db was detected, please check $log_file for more details."
return 1
fi
fi
}

check_log_file nb
check_log_file sb
Loading