]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: do not activate device that is not ready 9943/head
authorBoris Ranto <branto@redhat.com>
Mon, 27 Jun 2016 09:48:17 +0000 (11:48 +0200)
committerBoris Ranto <branto@redhat.com>
Thu, 11 Aug 2016 11:38:59 +0000 (13:38 +0200)
If the journal (or data) device is not ready when we are activating the
data (or journal) device, just print an info message and exit with 0 so
that the ceph-disk systemd service won't fail in this case.

Fixes: http://tracker.ceph.com/issues/15990
Signed-off-by: Boris Ranto <branto@redhat.com>
src/ceph-disk/ceph_disk/main.py

index 239bc50655f3c3fd974e690be45ba33dff6372ea..47426453725794f182139f38203d4dd0cf4f0758 100755 (executable)
@@ -3334,6 +3334,13 @@ def main_activate(args):
         else:
             raise Error('%s is not a directory or block device' % args.path)
 
+        # exit with 0 if the journal device is not up, yet
+        # journal device will do the activation
+        osd_journal = '{path}/journal'.format(path=osd_data)
+        if os.path.islink(osd_journal) and not os.access(osd_journal, os.F_OK):
+            LOG.info("activate: Journal not present, not starting, yet")
+            return
+
         if (not args.no_start_daemon and args.mark_init == 'none'):
             command_check_call(
                 [
@@ -3341,7 +3348,7 @@ def main_activate(args):
                     '--cluster={cluster}'.format(cluster=cluster),
                     '--id={osd_id}'.format(osd_id=osd_id),
                     '--osd-data={path}'.format(path=osd_data),
-                    '--osd-journal={path}/journal'.format(path=osd_data),
+                    '--osd-journal={journal}'.format(journal=osd_journal),
                 ],
             )
 
@@ -3736,6 +3743,12 @@ def main_activate_space(name, args):
             LOG.info('suppressed activate request on %s', path)
             return
 
+        # warn and exit with 0 if the data device is not up, yet
+        # data device will do the activation
+        if not os.access(path, os.F_OK):
+            LOG.info("activate: OSD device not present, not starting, yet")
+            return
+
         (cluster, osd_id) = mount_activate(
             dev=path,
             activate_key_template=args.activate_key_template,