From: Huber-ming Date: Tue, 7 Jun 2022 01:34:56 +0000 (+0800) Subject: rgw: check object appendable when check_disk_state X-Git-Tag: v18.0.0~224^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=418c86b655b6a8386cbb1e69239362a442165e50;p=ceph.git rgw: check object appendable when check_disk_state fix: https://tracker.ceph.com/issues/55904 Signed-off-by: Huber-ming --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index ffeea0d0fc3..55bd2406d67 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -9263,6 +9263,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, string etag; string content_type; ACLOwner owner; + bool appendable = false; object.meta.size = astate->size; object.meta.accounted_size = astate->accounted_size; @@ -9283,6 +9284,10 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, ldpp_dout(dpp, 0) << "WARNING: could not decode policy for object: " << obj << dendl; } } + iter = astate->attrset.find(RGW_ATTR_APPEND_PART_NUM); + if (iter != astate->attrset.end()) { + appendable = true; + } if (manifest) { RGWObjManifest::obj_iterator miter; @@ -9306,6 +9311,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, object.meta.content_type = content_type; object.meta.owner = owner.get_id().to_str(); object.meta.owner_display_name = owner.get_display_name(); + object.meta.appendable = appendable; // encode suggested updates @@ -9314,6 +9320,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, list_state.meta.mtime = object.meta.mtime; list_state.meta.category = main_category; list_state.meta.etag = etag; + list_state.meta.appendable = appendable; list_state.meta.content_type = content_type; librados::IoCtx head_obj_ctx; // initialize to data pool so we can get pool id