]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: check object appendable when check_disk_state 46547/head
authorHuber-ming <zhangsm01@inspur.com>
Tue, 7 Jun 2022 01:34:56 +0000 (09:34 +0800)
committerHuber-ming <zhangsm01@inspur.com>
Thu, 9 Jun 2022 02:38:29 +0000 (10:38 +0800)
fix: https://tracker.ceph.com/issues/55904

Signed-off-by: Huber-ming <zhangsm01@inspur.com>
src/rgw/rgw_rados.cc

index ffeea0d0fc31f4834aaec8d05ce6efe889a52436..55bd2406d673e68f6f5e90d0ddb751335efedf43 100644 (file)
@@ -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