rgw/multisite: check for late lease renewals#47728
Conversation
|
on heavy load setup, the following messages are showing (when lease time is set to 30sec instead of 2 minutes): |
|
@yuvalif great work on this |
cbodley
left a comment
There was a problem hiding this comment.
the is_locked() change is great 👍
src/rgw/rgw_cr_rados.h
Outdated
| int operate(const DoutPrefixProvider *dpp) override; | ||
|
|
||
| bool is_locked() const { | ||
| if (ceph::real_time::clock::now() - last_renew_try_time > ts_interval) { |
There was a problem hiding this comment.
i think the ceph::coarse_mono_clock is a better fit for the clock. mono because we only care about intervals, not absolute clock times. and coarse because these intervals are on the order of minutes
src/rgw/rgw_cr_rados.cc
Outdated
| ldout(store->ctx(), 20) << *this << ": couldn't lock " << obj << ":" << lock_name << ": retcode=" << retcode << dendl; | ||
| return set_state(RGWCoroutine_Error, retcode); | ||
| } | ||
| ldout(store->ctx(), 20) << *this << ": successfully lock " << obj << ":" << lock_name << dendl; |
src/rgw/rgw_cr_rados.h
Outdated
| #include "common/Throttle.h" | ||
|
|
||
| #include <atomic> | ||
| #include <chrono> |
There was a problem hiding this comment.
include common/ceph_time.h instead, since we're relying on its clocks and typedefs
| // renewal should happen between 50%-90% of interval | ||
| ldout(store->ctx(), 1) << *this << ": WARNING: did not renew lock " << obj << ":" << lock_name << ": within 90\% of interval. " << | ||
| (current_time - last_renew_try_time) << " > " << interval_tolerance << dendl; |
There was a problem hiding this comment.
i'm not crazy about warning at 90% unless we can offer specific advice to prevent the user from hitting this 100% latency barrier
i'm more concerned that this 100% barrier isn't an actual error. your change to is_locked() helps, but we can't guarantee that is_locked() will be called promptly. another rgw could still acquire and drop the lock in the meantime, and we'd log a warning here but sync would continue on like nothing happened
our lock requests are sent with set_may_renew(true) (see https://github.com/ceph/ceph/blob/f5c21acf/src/rgw/rgw_cr_rados.cc#L217) which means the request can either acquire or renew a lock. if RGWContinuousLeaseCR were to send its renewals with set_must_renew(true) instead, the OSD would reject renewal requests if the previous lock had expired
RGWContinuousLeaseCR would see that as an EBUSY error on renewal. can we put a good log message there instead, with some explanation like "high latency on the pool {obj.pool}"?
There was a problem hiding this comment.
i'm not crazy about warning at 90% unless we can offer specific advice to prevent the user from hitting this 100% latency barrier
i'm more concerned that this 100% barrier isn't an actual error. your change to
is_locked()helps, but we can't guarantee thatis_locked()will be called promptly. another rgw could still acquire and drop the lock in the meantime, and we'd log a warning here but sync would continue on like nothing happened
i can remove this warning. it does not say that lock was not successful, just that it was late.
my idea was to correlate that message with sync issues
our lock requests are sent with
set_may_renew(true)(see https://github.com/ceph/ceph/blob/f5c21acf/src/rgw/rgw_cr_rados.cc#L217) which means the request can either acquire or renew a lock. ifRGWContinuousLeaseCRwere to send its renewals withset_must_renew(true)instead, the OSD would reject renewal requests if the previous lock had expired
RGWContinuousLeaseCRwould see that as anEBUSYerror on renewal. can we put a good log message there instead, with some explanation like "high latency on the pool {obj.pool}"?
but the same continuous lease CR is used for the initial acquisition of the lock and its renewal.
maybe we can add an API to that class that allows switching between the modes?
There was a problem hiding this comment.
but the same continuous lease CR is used for the initial acquisition of the lock and its renewal.
maybe we can add an API to that class that allows switching between the modes?
exactly, right. i opened #47809 (but haven't compiled or tested it) that extends RGWSimpleRadosLockCR to support this. so RGWContinuousLeaseCR could have a rados::cls::lock::Lock member variable, and use set_may_renew() for the initial lock request and set_must_renew() afterwards
There was a problem hiding this comment.
i can remove this warning. it does not say that lock was not successful, just that it was late. my idea was to correlate that message with sync issues
yeah, i think the proposed error message meets that same goal. even if is_locked() sees that the lock probably expired, it will use drain_all() to wait for RGWContinuousLeaseCR to receive this lock response and print its error message before returning the -ECANCELED error up the call stack
There was a problem hiding this comment.
i'm happy to take up the rest of this work in #47809, we can merge this warning as is
also make lease renewal logs more uniform Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
7b4a366 to
c4960aa
Compare
|
jenkins test make check |
|
jenkins test api |
|
teuthology results: http://pulpito.front.sepia.ceph.com/yuvalif-2022-08-26_11:23:55-rgw-wip-yuval-cont-lease-distro-default-smithi/
|
|
jenkins test make check |
|
jenkins test api |
also make lease renewal logs more uniform
Signed-off-by: Yuval Lifshitz ylifshit@redhat.com
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