Skip to content

Commit e3752ec

Browse files
committed
Double check before connecting that the sentinel is still available, in case it was one that got removed but wasn't noticed.
1 parent 3e15959 commit e3752ec

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

redis/3-highly-available/usr/local/share/redis_functions.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ function sentinel_cleanup()
4949
echo "> Waiting for the sentinel to receive data from the other sentinels"
5050
sleep 11s
5151
echo "> Resetting sentinel data for $sentinel"
52-
redis-cli -h "$sentinel" -p 26379 SENTINEL RESET mymaster
52+
53+
if test_remote_ports "$sentinel:26379"; then
54+
redis-cli -h "$sentinel" -p 26379 SENTINEL RESET mymaster
55+
else
56+
echo "> Sentinel $sentinel doesn't appear to be active any more"
57+
fi
5358
done
5459
}
5560

0 commit comments

Comments
 (0)