mon, osd: Adding read (aka workload, primary) balance score#47555
mon, osd: Adding read (aka workload, primary) balance score#47555
Conversation
|
@rzarzynski - Can you see why my make check fails? It is related to a change I did, but 1 - it compiles for me and 2 - the fail is in under a crimson directory and I never touched files there. It seems that OSDMap.cc is moved and built also under the crimson tree and for some reason does not compile there. How can I fix such a problem (or how can I check it on my local machine). On my local machine I just build vstart. But the problem seems to be that a global variable that I use does not exist in the crimson built, and I need it... |
|
@ljflores - Please see the API test failures, it seems this build can't load some python modules, I don't understand how this relates to my changes... |
|
jenkins retest this please |
|
@JoshSalomon there is a boost failure that affects make check and the API test right now that is happening across PRs. So it is unrelated to your changes. |
|
jenkins test api |
ljflores
left a comment
There was a problem hiding this comment.
Giving an early approval since the draft looks overall very good! I have a few comments that you can review, and we should consider writing up a short bit of documentation that explains how the scores are calculated.
I'm thinking that the documentation can either be an added section here https://docs.ceph.com/en/latest/rados/operations/balancer/, or we can add an extra "workload" file in that general area.
src/mon/OSDMonitor.cc
Outdated
| OSDMap::wl_balance_info_t wlb_info; | ||
| f->open_object_section("workload_balance"); | ||
| f->dump_float("score (acting)", | ||
| osdmap.calc_wl_balance_score(g_ceph_context, pid, &wlb_info)); |
There was a problem hiding this comment.
What you need to do here is either pass in cct as the context, or, at the top of the file, include this line: if you want to use the global context:
#define dout_context g_ceph_context
When I grepped for "g_ceph_context" under src, I found a ton of examples, such as in mgr/DaemonServer.cc, where it is defined.
src/osd/OSDMap.cc
Outdated
| if (osds_crush_weight.count(osd)) { | ||
| total_weighted_prim_affinity += osds_crush_weight.at(osd) * get_primary_affinityf(osd); | ||
| } |
There was a problem hiding this comment.
Why is this "if" check necessary? If we're iterating over osds_crush_weight with a for loop, I don't see a reason why any OSD we need in line 5444 might not be in the osds_crush_weight map.
There was a problem hiding this comment.
You also already have oweight, so you don't need osds_crush_weight.at(osd).
src/osd/OSDMap.cc
Outdated
| return candidates; | ||
| } | ||
|
|
||
| float OSDMap::calc_wl_balance_score(CephContext *cct, int64_t pool_id, |
There was a problem hiding this comment.
We should make it clear that this function returns the acting score, but updates all other scores as well. (Maybe in a comment above the function definition in OSDMap.h would be good)
src/mon/OSDMonitor.cc
Outdated
| OSDMap::wl_balance_info_t wlb_info; | ||
| f->open_object_section("workload_balance"); | ||
| f->dump_float("score (acting)", | ||
| osdmap.calc_wl_balance_score(g_ceph_context, pid, &wlb_info)); |
There was a problem hiding this comment.
If I'm understanding correctly, does calling calc_wl_balance_score here return the acting score, but also update all the rest of the scores?
src/mon/OSDMonitor.cc
Outdated
| f->dump_int("pool_id", pid); | ||
| f->dump_string("pool_name", osdmap.get_pool_name(pid)); | ||
| pdata.dump(f.get()); | ||
| if (pdata.get_type() == pg_pool_t::TYPE_REPLICATED) { |
src/osd/OSDMap.cc
Outdated
| if (pdata.is_replicated()) | ||
| snprintf (wl_score_str, sizeof(wl_score_str), | ||
| " workload_balance_score %.2f", | ||
| calc_wl_balance_score(g_ceph_context, pid)); |
There was a problem hiding this comment.
FAILED: src/crimson/CMakeFiles/crimson-common.dir/__/osd/OSDMap.cc.o
/usr/bin/ccache /usr/bin/clang++-14 -DBOOST_ASIO_DISABLE_CONCEPTS -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DCEPH_INSTALL_DATADIR=\"/usr/local/share/ceph\" -DCEPH_INSTALL_FULL_PKGLIBDIR=\"/usr/local/lib/ceph\" -DCMAKE_INSTALL_LIBDIR=\"lib\" -DHAVE_CONFIG_H -DSEASTAR_API_LEVEL=6 -DSEASTAR_DEBUG -DSEASTAR_DEBUG_SHARED_PTR -DSEASTAR_DEFAULT_ALLOCATOR -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SHUFFLE_TASK_QUEUE -DSEASTAR_TYPE_ERASE_MORE -DWITH_SEASTAR=1 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -I/home/jenkins-build/build/workspace/ceph-pull-requests/build/src/include -I/home/jenkins-build/build/workspace/ceph-pull-requests/src -I/home/jenkins-build/build/workspace/ceph-pull-requests/src/seastar/include -I/home/jenkins-build/build/workspace/ceph-pull-requests/build/src/seastar/gen/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/build/boost/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/build/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/src/xxHash -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/src/rapidjson/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/src/jaegertracing/opentelemetry-cpp/api/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/src/jaegertracing/opentelemetry-cpp/exporters/jaeger/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/src/jaegertracing/opentelemetry-cpp/ext/include -isystem /home/jenkins-build/build/workspace/ceph-pull-requests/src/jaegertracing/opentelemetry-cpp/sdk/include -g -Werror -fPIC -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wno-inconsistent-missing-override -Wno-mismatched-tags -Wno-unused-private-field -Wno-address-of-packed-member -Wno-unused-function -Wno-unused-local-typedef -Wno-varargs -Wno-gnu-designator -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register -DCEPH_DEBUG_MUTEX -D_GLIBCXX_ASSERTIONS -fdiagnostics-color=auto -Wno-non-virtual-dtor -std=gnu++17 -U_FORTIFY_SOURCE -DSEASTAR_SSTRING -Wno-error=unused-result "-Wno-error=#warnings" -fstack-clash-protection -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr -std=c++20 -MD -MT src/crimson/CMakeFiles/crimson-common.dir/__/osd/OSDMap.cc.o -MF src/crimson/CMakeFiles/crimson-common.dir/__/osd/OSDMap.cc.o.d -o src/crimson/CMakeFiles/crimson-common.dir/__/osd/OSDMap.cc.o -c /home/jenkins-build/build/workspace/ceph-pull-requests/src/osd/OSDMap.cc
/home/jenkins-build/build/workspace/ceph-pull-requests/src/osd/OSDMap.cc:3959:25: error: use of undeclared identifier 'g_ceph_context'
calc_wl_balance_score(g_ceph_context, pid));
^
1 error generated.
The compiler testifies g_ceph_context is undeclared here. This may happen in crimson as we have WITH_SEASTAR in multiple places, also around includes. How about including global/global_context.h?
To replicate locally you would need to install-deps.sh --crimson and also do_cmake.sh -DWITH_SEASTAR=ON.
There was a problem hiding this comment.
@rzarzynski
For some reasons install-deps.sh --crimson did not do anything for me, I ran do-cmake.sh several times and installed the missing packages that it found, but now I get the following errors which I don't know how to solve
CMake Error at src/seastar/CMakeLists.txt:754 (message):
Sanitizers not found!
There was a problem hiding this comment.
@JoshSalomon Radek has raised this PR to help with this: #47697
|
@xiexingguo want to have a look? I know you've worked on the balancer in the past. |
|
@JoshSalomon I started a draft of documentation for this here: https://docs.google.com/document/d/1hVTbaaQd87HFkhhahfe4_HC7EQZ1KCz0f47cokQXk-o/edit#heading=h.yrnz08eo5nml |
|
jenkins test api |
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
|
jenkins retest this please |
|
jenkins test make check |
|
@xiexingguo any thoughts on this PR? |
|
@JoshSalomon I'd say we can take this out of draft form since we agreed to do the documentation in #44565. |
c0e77eb to
55ce98e
Compare
|
jenkins retest this please |
|
I will test the new commit with this build: https://shaman.ceph.com/builds/ceph/wip-lflores-testing-2022-12-12-1839/ac7744ed2e2fd8a27b7b9e433f1822d6bee5dd87/ |
|
jenkins test api |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@JoshSalomon this branch needs to be rebased now. |
|
@JoshSalomon to rebase your branch and resolve conflicts, follow these steps:
You're done! |
474038d to
8b62a76
Compare
|
jenkins test api |
1 similar comment
|
jenkins test api |
|
jenkins test make check |
Signed-off-by: Josh Salomon <jsalomon@redhat.com>
|
Rados suite review: http://pulpito.front.sepia.ceph.com/?branch=wip-lflores-testing-2023-02-06-1529 Failures, unrelated: Details: |
|
When you get a chance, please squash the commits so they make sense. And make sure that each commit has a "Signed-off-by: " line, as well as a proper title, i.e.: ` |
for replicated pools.
osd: Added workload balance score to the command
ceph osd pool ls detail
(different flavors for console output and json/xml output)
mon: Added command 'osd rm-primary-temp'
(developers only) rm was not working
vstart: Added osd debug messages into mon log with -d flag
For commands that execute methonds in OSD module
Signed-off-by: Josh Salomon <jsalomon@redhat.com>
119ff55 to
8ed66d3
Compare
|
Merged!! :D |
Added a read (aka primary) balance score to the command 'ceph osd pool ls detail'
The score is based on the distribution of acting primaries so it reflects the performance limit on the current configuration (rather than the stable configuration). More information, including the stable configuration score can be retrieved in the json and xml output of the same command (using the -f flag).
Additional minor change - in order to test the read balance score I used the command 'ceph osd primary-temp' - this is a developers-only command that changes the acting primary. It was supposed to restore the acting primary to a PG by using OSD id of -1. This did not work since you can't pass negative number as OSD id. In order to fix that I added a command 'ceph osd rm-primary-temp [pgid]' that restores the default acting primary.
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows