Open GoogleCodeExporter opened 9 years ago
The workaround we're going to apply is :
>>>
timeout 3m tail -f /var/log/redis/redis-server.log | grep -m1 -q 'MASTER <->
SLAVE sync: Finished with success' &
echo -n "started, waiting for master-slave sync... "
if wait $!
then
echo "done"
else
echo "failed"
fi
<<<
that
- tail (in background) the log files (at max for 3 minutes) checking it the
sync has finished succesfully
- it waits for the background process to complete
It's ugly as hell, it's a bashism ($! is bash-specific) and it's based on the
fact the sync takes time so from when we start teh redis-server and we start
tailing the log files the sync hasn't completed yet.
Of course, a proper support on redis-server side is still our preferred
solution.
Cheers,
Sandro
Original comment by matrixhasu
on 13 Jul 2011 at 9:32
Original issue reported on code.google.com by
matrixhasu
on 6 Jul 2011 at 8:35