Repository navigation
common: fix the ms_async_op_threads not applied successfully for daemons running in foreground mode - #63390
Conversation
9f7a6ed to
b11cb0a
Compare
rzarzynski
left a comment
There was a problem hiding this comment.
Almost LGTM; just a nit.
There was a problem hiding this comment.
Yeah, before forking we do:
void CephContext::notify_pre_fork()
{
{
std::lock_guard lg(_fork_watchers_lock);
for (auto &&t : _fork_watchers) {
t->handle_pre_fork();
}
}
{
// note: we don't hold a lock here, but we assume we are idle at
// fork time, which happens during process init and startup.
auto i = associated_objs.begin();
while (i != associated_objs.end()) {
if (associated_objs_drop_on_fork.count(i->first.first)) {
i = associated_objs.erase(i);
} else {
++i;
}
}
associated_objs_drop_on_fork.clear();
}
}…ceph daemons 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. Fixes: https://tracker.ceph.com/issues/71401 Signed-off-by: dongdong tao <[email protected]>
b11cb0a to
30d66ff
Compare
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
@rzarzynski could you help take another look? |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
|
Hello @sseshasa @rzarzynski , this patch should be backported, could you help to change the state of bug https://tracker.ceph.com/issues/71401 to pending backport state ? |
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.
fixes: https://tracker.ceph.com/issues/71401
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition