Skip to content

Commit

Permalink
add check of write to ovn sb db for ovn-controller (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Oct 27, 2022
1 parent 4e17fe7 commit d6ddf89
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dist/images/ovs-healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,19 @@ alias ovn-ctl='/usr/share/ovn/scripts/ovn-ctl'

ovs-ctl status
ovn-ctl status_controller

# check if ovn-controller can write to ovn sb db
file="/var/log/ovn/ovn-controller.log"
if [ -e $file ]
then
result=$(tail -6 $file)
if [[ "$result" =~ "clustered database server has stale data" ]]
then
echo "check write to ovn sb db, clustered database server has stale data, run sb-cluster-state-reset command to restore"
pid=$(cat /var/run/ovn/ovn-controller.pid)
ovs-appctl -t /var/run/ovn/ovn-controller.$pid.ctl sb-cluster-state-reset
echo "finish exec cmd sb-cluster-state-reset"
else
echo "check write to ovn sb db success"
fi
fi

0 comments on commit d6ddf89

Please sign in to comment.