Project

General

Profile

Actions

Bug #41404

closed

[rbd] rbd map hangs up infinitely after osd down

Added by fan chen over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
luminous,mimic,nautilus
Regression:
Yes
Severity:
1 - critical
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

this issue could be 100% reproduced, after down several osd services for a long time, it would cause the "rbd map" command hanging up. after doing investigation, we found the steps of reproduction:
1. down serveral osd services
2. rbd map would hangup at:
[<ffffffffc05cc571>] __rbd_obj_request_wait.constprop.55+0x31/0xe0 [rbd]
[<ffffffffc05cd1fb>] rbd_obj_method_sync.constprop.54+0x1ab/0x250 [rbd]
[<ffffffffc05d1965>] rbd_dev_image_id+0xe5/0x280 [rbd]
[<ffffffffc05d36ba>] do_rbd_add.isra.47+0x4ba/0xe50 [rbd]
[<ffffffffc05d4094>] rbd_add+0x24/0x30 [rbd]
[<ffffffff8143d3e7>] bus_attr_store+0x27/0x30
[<ffffffff81280046>] sysfs_write_file+0xc6/0x140
[<ffffffff81200a9d>] vfs_write+0xbd/0x1e0
[<ffffffff812018af>] SyS_write+0x7f/0xe0
[<ffffffff816b50c9>] system_call_fastpath+0x16/0x1b
3. then up the osd services
4. /dev/rbdX created
5. but rbd map hanged up at poll() in wait_for_udev_add

we found the root reason:
after down osd services, it would cause the io hang up in step 2, but the udev monitor fd have already setup and enabled, so during this period of osd down, the monitor fd could also receive messages from systemd udevd service, in this situation, the monitor fd socket buffer may be full because of rbd_add hanging up. event if we recover the osd services and the sysfs_write_rbd_add returned, the udevd netlink event may also be dropped because of socket buffer is full(see netlink manpage). so here the rbd map may never be able to receive the rbd and block events, then cause hanging up.

so in order to solve this issue, can we increase the socket buffer size, by default on some distros, such as centos, the buffer size
is 208k, which is too small?

or fork an individual thread to receive udevd events beside the main thread?


Related issues 5 (0 open5 closed)

Related to rbd - Bug #41036: concurrent "rbd unmap" failures due to udevResolvedIlya Dryomov07/31/2019

Actions
Related to Ceph - Fix #42523: backport "common/thread: Fix race condition in make_named_thread" to mimic and nautilusResolvedIlya Dryomov10/29/2019

Actions
Copied to rbd - Backport #42425: luminous: [rbd] rbd map hangs up infinitely after osd downResolvedIlya DryomovActions
Copied to rbd - Backport #42426: mimic: [rbd] rbd map hangs up infinitely after osd downResolvedIlya DryomovActions
Copied to rbd - Backport #42427: nautilus: [rbd] rbd map hangs up infinitely after osd downResolvedNathan CutlerActions
Actions

Also available in: Atom PDF