mon/MonmapMonitor: do not propose on error in prepare_update#50503
mon/MonmapMonitor: do not propose on error in prepare_update#50503
Conversation
There was a problem hiding this comment.
I think the commit could be split into three separate commits that solve separate issues.
-
MonMapMonitor: do not propose changes on error in prepare_update/prepare_command
-
MonMapMonitor: commit proposed map changes initiated by a
ceph moncommand before replying
(This seems like a more important fix than the one above. It changes the monitor's handling ofceph moncommands that has existed since #6854) -
MonMapMonitor: do not propose changes when
mon enable msgr-2command is called on monitors that already have msgr2 enabled
I've broken this out into a separate commit but its changes end up modified again as part of
I restructured the code but I do not think it proposed when |
Yes, makes sense. |
c9b7c07 to
d91c42d
Compare
good point. Fixed |
|
@yuriw please include in the next RADOS run. |
|
jenkins test make check arm64 |
|
Hey @batrick, I'm seeing some failures that look related: Slow ops from a mon command that was changed in this PR Here was the test link: And here are a few more jobs that were affected: |
|
Go ahead and re-add "needs-qa" when it's ready for testing again! |
|
@ljflores this is ready for QA again but please don't QA with Ilya's PR again. 😆 |
|
@rzarzynski are you on the hook for reviewing monitor PRs? This one has unfortunately gotten more complex. See |
|
So another added benefit I didn't plan for is that the commits mentioned in #50503 (comment) make the replies from the monitors significantly faster. For example, on a humble vstart cluster: RTT is 82ms instead of what would normally be ~90ms. That's an ~9% improvement. Note replies are currently only sent after pending is created. It can be hard to benchmark this because mon command routing can add latency. I have a test which creates a single RADOS session but I haven't yet figured out how to force it to connect to the leader for the benchmark. |
This is useful for benchmarks particularly that require consistent rank choice (i.e. leader). Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This will replace many uses of "wait_for_finished_proposal" where a reply is simply waiting for pending to commit. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Once PaxosService::refresh is called, the commit is final and will not
be rolled back. We should immediately send out any replies depending on
that event. This avoids a problem where PaxosService::update_from_paxos
indicates the mons need to re-bootstrap (because of a monmap change) and
these pending reply contexts are dropped in PaxosService::restart.
The cherry on top for this change is that mon commands enjoy a shorter
RTT latency as replies are sent out faster. Using the new
bench_commit.py script:
main branch:
min/max/mean/stddev: 0.015813/0.613919/0.031615/0.024087
min/max/mean/stddev: 0.015737/0.255008/0.031492/0.017930
min/max/mean/stddev: 0.014242/0.205763/0.031969/0.018022
min/max/mean/stddev: 0.014172/0.270256/0.032070/0.021079
min/max/mean/stddev: 0.017767/0.471187/0.032751/0.025317
this commit:
min/max/mean/stddev: 0.010476/0.158475/0.026324/0.013662
min/max/mean/stddev: 0.016866/0.099403/0.027938/0.010508
min/max/mean/stddev: 0.014013/0.127512/0.026847/0.010340
min/max/mean/stddev: 0.013098/0.172725/0.028979/0.012998
min/max/mean/stddev: 0.016934/0.292218/0.029252/0.014904
About a 10-20% reduction in latency.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
If the monmap is changed, do not reply to command until committed! Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Fixes: https://tracker.ceph.com/issues/58974 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
|
rebased + commit message changes |
|
jenkins test api |
1 similar comment
|
jenkins test api |
ljflores
left a comment
There was a problem hiding this comment.
Looks good, I like the performance analysis you added!
| _start_hunting(); | ||
|
|
||
| if (rank == -1) { | ||
| rank = cct->_conf.get_val<int64_t>("mon_client_target_rank"); |
src/mon/MonmapMonitor.cc
Outdated
| // we are returning to the user; do not propose. | ||
| if (propose) { | ||
| wait_for_commit(op, new Monitor::C_Command(mon, op, err, rs, get_last_committed() + 1)); | ||
| } else { |
| } | ||
| if (strategy == pending_map.strategy) { | ||
| err = 0; | ||
| goto reply_no_propose; |
|
|
|
@batrick If you haven't started testing this already, I can put it through testing in the run I am starting today/tomorrow. |
I'll handle it, thanks @rishabh-d-dave |
* refs/pull/50503/head: mon: do not change pending if strategy is unchanged mon/MonmapMonitor: do not propose on error in prepare_update mon/MonmapMonitor: wait for commit before reply mon: use wait_for_commit to reply mon: add context list for commit wait mon: remove unused method test/mon: add commit benchmark script mon/MonClient: provide config to target specific rank
|
Nothing out of the ordinary from this PR: https://tracker.ceph.com/projects/cephfs/wiki/Main#2023-Sep-12 I think we can merge this unless @ljflores @rzarzynski you would like more |
|
Apologies @batrick, this was tested and rados-approved: https://tracker.ceph.com/projects/rados/wiki/MAIN#httpstrellocomcpMEWaauy1825-wip-yuri3-testing-2023-08-15-0955 I missed adding a comment here. |
Great, thanks Laura! |
Also: correct a serious protocol error where the monitor would reply to a command before the proposal is committed.
Fixes: https://tracker.ceph.com/issues/58974
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