Repository navigation
rgw: CompleteMultipartUpload renews cls_lock on multipart meta object - #67696
Conversation
3a73a6d to
b63d7ae
Compare
because the lock renewal request is sent every half interval, don't allow the lock duration to get small enough that rados request latency becomes significant Signed-off-by: Casey Bodley <[email protected]>
Config Diff Tool Output+ added: rgw_mp_lock_inject_renewal_error (rgw.yaml.in)
+ added: rgw_mp_lock_inject_delay (rgw.yaml.in)
! changed: rgw_mp_lock_max_time: old: (rgw.yaml.in)
! changed: rgw_mp_lock_max_time: new: 2_min (rgw.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
|
i've replaced the old strategy based on |
adamemerson
left a comment
There was a problem hiding this comment.
This looks good and well-thought-out.
|
i added a commit with some config options that i'm using to test this. i'm currently debugging some crashes from |
the crash came from coroutine cancellation, which was forwarding the cancellation signal to its timer. but that timer was on the coroutine's stack, and was already destroyed when the coroutine returned: i'm not sure why the cancellation slot still refers to the timer - i've seen this pattern work fine elsewhere. but moving the timer into a member variable so it's still in scope during the destructor seems to resolve the crash |
|
for testing, i ran vstart with these arguments: then started a single multipart upload: log trace of that CompleteMultipartUpload request shows the request failing with 500 before calling the same test without |
if lock renewal fails, is_locked() will return false. check that just before upload->complete() goes on to write/overwrite the head object, and return the same ERR_INTERNAL_ERROR from lock contention Fixes: https://tracker.ceph.com/issues/75375 Signed-off-by: Casey Bodley <[email protected]>
make it safe for other threads to call clear_locked() and is_locked() Signed-off-by: Casey Bodley <[email protected]>
this duration ultimately gets passed down to cls_lock's set_duration() function, which has overloads for both utime_t and ceph::timespan. prefer ceph::timespan because it also works with boost asio timers Signed-off-by: Casey Bodley <[email protected]>
|
updated to replace the blocking waits on std::future with optional-yielding waits on ceph::async::async_cond. the testing shown above with |
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
CompleteMultipartUpload depends on this lock to ensure consistency of uploads and protect against data loss, so we should try very hard to hold this lock as long as it takes to complete successfully MPRadosSerializer accomplishes this by spawning a background lock renewal coroutine. this coroutine is started during a successful call to try_lock(), and stopped before unlock() releases the lock Fixes: https://tracker.ceph.com/issues/75375 Signed-off-by: Casey Bodley <[email protected]>
rgw_mp_lock_inject_delay can inject delays in multipart complete to make sure lock renewal requests get issued rgw_mp_lock_inject_renewal_error can inject lock renewal errors to test the error handling Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
| if (!serializer->is_locked()) { | ||
| // lock renewal failed, it's not safe to commit the head object | ||
| op_ret = -ERR_INTERNAL_ERROR; | ||
| s->err.message = "This multipart completion is already in progress"; | ||
| return; |
There was a problem hiding this comment.
it looks like this broke rgw/dbstore tests because dbstore's try_lock() is a noop
There was a problem hiding this comment.
added commits to set/clear is_locked() for dbstore and posix backends (cc @dang)
Signed-off-by: Casey Bodley <[email protected]>
|
passed qa after reruns for dead jobs: 2 rgw/multisite jobs failed with:
17 other jobs failed with "valgrind error: SyscallParam" tracked in https://tracker.ceph.com/issues/73437 |
|
|
jenkins test make check arm64 |
A refused completion drops its parts' index entries (tracker #80907); a completion whose meta object outlives its head write lets a retry or an abort delete the object's data (tracker #80896), which rgw-go closes with the completion record of ceph/ceph#72103; the completion lock is not kept past rgw_mp_lock_max_time at the floor releases (tracker #75375, fixed on main by ceph/ceph#67696); several GC chains sent under one tag leave only the last on a gc shard still on the omap log; and a completion that loses its head write's race answers success and leaks its parts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
when a client retries a CompleteMultipartUpload request, it's possible that the earlier request had successfully written the head object. in that case, the retried request will overwrite that head object and schedule all of its tail objects for garbage collection
because the retried CompleteMultipartUpload request is likely using most/all of the same part objects as the initial request, this new object will become corrupted once garbage collection takes effect
to address this, store the multipart upload id in an xattr of the head object, and prevent multipart uploads from overwriting an existing head object with the same upload idto address this, prevent the 'multipart meta' object's cls_lock from expiring by spawning a lock renewal coroutine. as long as the lock is held, racing CompleteMultipartUpload requests won't be able to observe the upload in an intermediate state and write a conflicting update to its head object
Fixes: https://tracker.ceph.com/issues/75375
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 DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.