Repository navigation
rgw: fix rgw hang when do RGWRealmReloader::reload after go SIGHUP - #16417
Conversation
|
@cbodley please have a look, thanks! |
mattbenjamin
left a comment
There was a problem hiding this comment.
looks promising, defer to one of the multisite folks for approval
cbodley
left a comment
There was a problem hiding this comment.
good catch, thanks. can you expand a bit on the other issues with quota fetch?
|
Just issue with low possibility that will cause quota stats incorrect. please have a look at codes below: int RGWRados::get_bucket_stats_async(RGWBucketInfo& bucket_info, |
thanks, looks like you're right. it also accesses |
|
you are right, so race result:
|
|
@fangyuxiangGL could you move that call to |
|
moved get_ctx->put() down |
838fe89 to
9571609
Compare
|
I am wrong with saying that "if part of async io sent was called back before get_ctx->unset_cb(), bucket quota stats will be incorrect"; in fact, every async io only update its temp stats and only calculated totally when (pendings == 0). But there is an issue when exception happened, considered that pengdings == 0 and retcode < 0(real fail from rados cluster, not early fail) when code reach here:
then cb->handle_response follow in: void BucketAsyncRefreshHandler::handle_response(const int r) RGWStorageStats bs; for (const auto& pair : *stats) { } cache->async_refresh_response(user, bucket, bs); i introduced async_refresh_fail to RGWQuotaCache, and should be called when got error response, it just put the reference without update the quota stats. @cbodley, now it's very pleased to hear your opinions, thanks! |
Quota async processer reference count err when bucket has no explicit shard Fixes: http://tracker.ceph.com/issues/20686 Signed-off-by: fang yuxiang [email protected]
thanks for the explanation, the |
|
jenkins test this please |
pendings in RGWGetBucketStatsContext is initialized to zero when rgw_override_bucket_index_max_shards is zero.
so --pendings will got 0xffffffff, which lead async_refcount not put correctly, then the thread handle RGWRealmReloader::reload will hang, then cause request process worker thread of rgw frontend hang(the write lock was held by RGWRealmReloader::reload handle thread, but request process worker thread need to get read lock)
the procedure of quota fetch is a bit tricky and worse, this fix is not perfect, but is better with minimum changes
http://tracker.ceph.com/issues/20686