From 0542a95b686eabe96e1a71f6a8c92dcba2a7b4e8 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 1 Jun 2017 14:46:13 +0200 Subject: [PATCH] Common: Improve check pgs For some reason we changed the check of pgs but it appears it could be dangerous because the current check might satisfied as long as 1 PG is active+clean. Signed-off-by: Guillaume Abrioux --- roles/ceph-common/templates/restart_osd_daemon.sh.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ceph-common/templates/restart_osd_daemon.sh.j2 b/roles/ceph-common/templates/restart_osd_daemon.sh.j2 index cb420aef6..05e3ef9ce 100644 --- a/roles/ceph-common/templates/restart_osd_daemon.sh.j2 +++ b/roles/ceph-common/templates/restart_osd_daemon.sh.j2 @@ -6,7 +6,7 @@ CEPH_CLI="--name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/{{ c check_pgs() { while [ $RETRIES -ne 0 ]; do - ceph $CEPH_CLI -s | grep -sq 'active+clean' + test "$(ceph $CEPH_CLI -s | grep pgmap | sed -r 's/.*: ([0-9]+) pgs.*/\1/g')" -eq "$(ceph $CEPH_CLI -s | egrep '\sactive\+clean' | sed -r 's/[^0-9]*//g')" && ceph $CEPH_CLI health | egrep -sq "HEALTH_OK|HEALTH_WARN" RET=$? test $RET -eq 0 && exit 0 sleep $DELAY