Project

General

Profile

Bug #41297

Updated by Mark Kogan almost 5 years ago

Following an  
 <pre> 
 /bin/radosgw-admin bucket rm --bucket=<BUCKET> --bypass-gc --purge-objects 
 </pre> 
 operation is aborted by <ctrl>-c (or OOM) 

 in src/rgw/rgw_rados.cc : cls_bucket_list_unordered() 

 <pre><code class="cpp"> 
 
     cls_rgw_bucket_list_op(op, marker, prefix, num_entries, 
                            list_versions, &result); 
     r = index_ctx.operate(oid, &op, nullptr); 
     if (r < 0) 
       return r; 

     for (auto &entry (auto& entry : result.dir.m) 
     { 
       rgw_bucket_dir_entry &dirent rgw_bucket_dir_entry& dirent = entry.second; 

       bool force_check = force_check_filter && 
                          
	 force_check_filter(dirent.key.name); 
       if ((!dirent.exists && !dirent.is_delete_marker()) || 
           
	   !dirent.pending_map.empty() || 
           
	   force_check) 
       { 
         
	 /* there are uncommitted ops. We need to check the current state, 
	  * and if the tags are old we need to do cleanup as well. */ 
         
	 librados::IoCtx sub_ctx; 
         
	 sub_ctx.dup(index_ctx); 
         
	 r = check_disk_state(sub_ctx, bucket_info, dirent, dirent, updates[oid], updates[oid] 
             , null_yield); 
         
	 if (r < 0 && r != -ENOENT) 
         { 
           
	   return r; 
         
	 } 
       } 

       // at this point either r >=0 or r == -ENOENT 
       if (r >= 0) 
       { // i.e., if r != -ENOENT 
         
	 ldout(cct, 10) << "RGWRados::cls_bucket_list_unordered: got " << 
	   dirent.key.name << "[" << dirent.key.instance << "]" << dendl; 
         ... 
       } 
 

 </code></pre> 

 once an object sets *"r"* to -ENOENT in 
 <pre><code class="cpp"> 
     r = check_disk_state(sub_ctx, bucket_info, dirent, dirent, updates[oid], null_yield); 
     if (r < 0 && r != -ENOENT) { 
 </code></pre> 

 the objects in the current _results_ batch will not be processed until the  
 next batch of objects is received from the next call _cls_rgw_bucket_list_op()_ 

 (the value of *"r"* is not reset back to 0 for the following entries in the results batch) 

Back