Race condition: rbd device not yet available when mkfs is called
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rabbitmq-server (Juju Charms Collection) |
Fix Released
|
Undecided
|
Andreas Hasenack |
Bug Description
When using rabbitmq-server with ceph, there is a race condition with the device setup:
2013-08-08 17:58:24 INFO juju server.go:105 worker/
2013-08-08 17:58:24 DEBUG juju server.go:106 worker/
2013-08-08 17:58:24 INFO juju juju-log.go:64 rabbitmq-server/0 ceph:9: ceph: Creating RBD image (rabbitmq1).
2013-08-08 17:58:24 INFO juju server.go:105 worker/
2013-08-08 17:58:24 DEBUG juju server.go:106 worker/
2013-08-08 17:58:24 INFO juju juju-log.go:64 rabbitmq-server/0 ceph:9: ceph: Mapping RBD Image as a Block Device.
2013-08-08 17:58:24 INFO juju server.go:105 worker/
2013-08-08 17:58:24 DEBUG juju server.go:106 worker/
2013-08-08 17:58:24 INFO juju juju-log.go:64 rabbitmq-server/0 ceph:9: ceph: Formatting block device /dev/rbd/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK mke2fs 1.42 (29-Nov-2011)
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK Could not stat /dev/rbd/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK The device apparently does not exist; did you specify it correctly?
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK Traceback (most recent call last):
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/var/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK utils.do_
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/var/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK hook_func()
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/var/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK system_
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/var/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK make_filesystem
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/var/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK execute(cmd)
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/var/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK subprocess.
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK File "/usr/lib/
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK raise CalledProcessEr
2013-08-08 17:58:24 INFO juju context.go:235 worker/uniter: HOOK subprocess.
2013-08-08 17:58:24 ERROR juju uniter.go:352 worker/uniter: hook failed: exit status 1
In summary:
1) create pool
2) create image
3) map block storage <--- triggers the device appearing in /dev/rbd/pool/image
4) mkfs
If (4) is done too quickly after (3), the device might not be there yet, resulting in the above error. Step (4) should wait a bit until the device appears before attempting to mkfs it.
Related branches
- Adam Gandelman (community): Approve
-
Diff: 46 lines (+18/-6)2 files modifiedhooks/lib/ceph_utils.py (+17/-5)
revision (+1/-1)
Changed in rabbitmq-server (Juju Charms Collection): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
status: | New → In Progress |
Changed in rabbitmq-server (Juju Charms Collection): | |
status: | In Progress → Fix Released |
tags: | added: landscape |