Project

General

Profile

Actions

Bug #71401

closed
DT DT

Changing the value of ms_async_op_threads in mon config db does not apply to OSD successfully even after a restart

Bug #71401: Changing the value of ms_async_op_threads in mon config db does not apply to OSD successfully even after a restart

Added by dongdong tao over 1 year ago. Updated 30 days ago.

Status:
Backporting
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Due date:
% Done:

0%

Component(RADOS):
OSD
Pull request ID:
Tags (freeform):
Fixed In:
v20.3.0-4261-g3ed04b6353
Released In:
v21.2.0~1659
Upkeep Timestamp:
2026-11-04T01:07:33+00:00

Description

This impact ceph daemons running in foreground mode(adding -f option), unfortunately, running in foreground has been the default for years. We should fix it.

This is very easy to reproduce, take ceph-osd as an example:
1. Ensure the ceph-osd is running with option -f (As far as I know, it's the default for upstream ceph and ubuntu ceph package)
e.g. /usr/bin/ceph-osd -f --cluster ceph --id 2 --setuser ceph --setgroup ceph

2. ceph config set osd ms_async_op_threads 5

3. Restart ceph-osd

4. You will see ms_async_op_threads is upadated to 5 from both the config db dump and the config show of osd's admin socket command

5. However, if you check the actual number of messenger threads with command: pgrep ceph-osd | xargs -i pstree -altp {} | grep -e 'ceph-osd,' -e msgr-worker

 ceph-osd,1381 -f --cluster ceph --id 2 --setuser ceph --setgroup ceph
      |-{msgr-worker-0},1429
      |-{msgr-worker-1},1430
      |-{msgr-worker-2},1431
You'll find the actual async messenger thread number remains the original value 3, but the expected number of threads is 5.

I did some investigation, and the reason is as below:
During the initialization, OSD needs to create a temporary messenger to read config db from the ceph-mon.
This temporary messenger will need to create async messenger threads according to the local/default value of "ms_async_op_threads" .
If this option is not specified in ceph.conf, it will by default create 3 threads, then use these threads to read config db from ceph-mon.
Those threads are associated to a stack singletion object.
Now here is the difference between OSD running in foreground and background:
a. In background mode, this singleton object will be dropped before forking the child process in function notify_pre_fork,
then the new ms_async_op_threads fetched from mon config db will be used to create later messenger threads, this is what we want.

b. In foreground mode, this singleton object will not be dropped and will be reused by all later messengers,
thus the number of threads doesn't change.

I propose a fix to drop the singleton object that was meant to be temporary for foreground ceph daemons.


Related issues 2 (1 open — 1 closed)

Copied to RADOS - Backport #74351: tentacle: Changing the value of ms_async_op_threads in mon config db does not apply to OSD successfully even after a restartResolved

Actions
Copied to RADOS - Backport #74352: squid: Changing the value of ms_async_op_threads in mon config db does not apply to OSD successfully even after a restartNew

Actions

RZ Updated by Radoslaw Zarzynski over 1 year ago Actions #2

Reviewed.

RZ Updated by Radoslaw Zarzynski over 1 year ago Actions #3

  • Status changed from New to Fix Under Review
  • Pull request ID set to 63390

LF Updated by Laura Flores over 1 year ago Actions #4

Fix still under review.

DT Updated by dongdong tao over 1 year ago Actions #5

PR is still awaiting review — @Radoslaw Zarzynski @Laura Flores, could you please take another look?

RZ Updated by Radoslaw Zarzynski about 1 year ago Actions #6

Review-in-progress. I will take another look.

LF Updated by Laura Flores about 1 year ago Actions #7

RZ Updated by Radoslaw Zarzynski about 1 year ago Actions #8

Bump up.

LF Updated by Laura Flores about 1 year ago Actions #9

Review in progress.

RZ Updated by Radoslaw Zarzynski about 1 year ago Actions #10

Bump up/

LF Updated by Laura Flores about 1 year ago Actions #11

Bump up

RZ Updated by Radoslaw Zarzynski about 1 year ago Actions #12

Sent to QA.

RZ Updated by Radoslaw Zarzynski about 1 year ago Actions #13

scrub note: awaits QA.

LF Updated by Laura Flores about 1 year ago Actions #14

  • Assignee set to dongdong tao

RZ Updated by Radoslaw Zarzynski about 1 year ago Actions #15

scrub note: picked up by QA.

UB Updated by Upkeep Bot about 1 year ago Actions #16

  • Status changed from Fix Under Review to Resolved
  • Merge Commit set to 3ed04b63533532d05b290e68f46459d75ddacd6f
  • Fixed In set to v20.3.0-4261-g3ed04b6353
  • Upkeep Timestamp set to 2025-11-20T03:26:07+00:00

DT Updated by dongdong tao about 1 year ago Actions #17

  • Backport set to tentacle, squid

SK Updated by Srinivasa Bharath Kanta 11 months ago Actions #18

  • Status changed from Resolved to Pending Backport

UB Updated by Upkeep Bot 11 months ago Actions #19

  • Copied to Backport #74351: tentacle: Changing the value of ms_async_op_threads in mon config db does not apply to OSD successfully even after a restart added

UB Updated by Upkeep Bot 11 months ago Actions #20

  • Copied to Backport #74352: squid: Changing the value of ms_async_op_threads in mon config db does not apply to OSD successfully even after a restart added

UB Updated by Upkeep Bot 11 months ago Actions #21

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #22

  • Status changed from Pending Backport to Backporting
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2025-11-20T03:26:07+00:00 to 2026-08-27T18:23:17+00:00

UB Updated by Upkeep Bot about 1 month ago Actions #23

  • Released In set to v21.2.0~1658
  • Upkeep Timestamp changed from 2026-08-27T18:23:17+00:00 to 2026-10-24T01:13:03+00:00

UB Updated by Upkeep Bot 30 days ago Actions #24

  • Released In changed from v21.2.0~1658 to v21.2.0~1659
  • Upkeep Timestamp changed from 2026-10-24T01:13:03+00:00 to 2026-11-04T01:07:33+00:00
Actions

Also available in: PDF Atom