Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the details in bucket deletion

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

I believe many inexperienced people don't know what to do about the details in the deletion of bucket. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Problem description

Some people in the community group said that some data remained after the deletion of bucket, which was verified by the version of ceph 10.2.x.

Test case

From boto.s3.connection import S3Connectionimport botoconn = boto.connect_s3 (aws_access_key_id ='', aws_secret_access_key ='', host = 's3.cephbook.compositions, port = 80, is_secure = False, calling_format = boto.s3.connection.OrdinaryCallingFormat () ) bucket = conn.create_bucket ('foo') # bucket.delete ()

Before deletion

Root@demohost:/home/user# rados ls-p rgw.rootfoo.bucket.meta.foo:70af9a54-20bb-480b-92f4-cbdeef0b775c.217357.1

After deletion

Cause Analysis of root@demohost:/home/user# rados ls-p rgw.root.bucket.meta.foo:70af9a54-20bb-480b-92f4-cbdeef0b775c.217357.1 # residue

The deletion of meta file depends on whether multi-cluster synchronization is enabled.

# src/rgw/rgw_rados.cc op_ret = store- > delete_bucket (s-> bucket, ot); # entry. / * if the bucket is not synced we can remove the meta file * / if (! is_syncing_bucket_meta (bucket)) {RGWObjVersionTracker objv_tracker; string entry = bucket.get_key (); r = rgw_bucket_instance_remove_entry (this, entry, & objv_tracker); if (r

< 0) { return r; } /* remove bucket index objects*/ map::const_iterator biter; for (biter = bucket_objs.begin(); biter != bucket_objs.end(); ++biter) { index_ctx.remove(biter->

Second);}}

To meet the following four situations, the deletion of meta file will not take place.

Current period is not the latest version zonegroup is non-master zonegroup

The current cluster has only a single zonegroup, and there is only one zone. The current zone is not a master zone.

/ * Check to see if the bucket metadata could be synced * bucket: the bucket to check * Returns false is the bucket is not synced * / bool RGWRados::is_syncing_bucket_meta (rgw_bucket& bucket) {/ * no current period * / if (current_period.get_id () .empty ()) {return false;} / * zonegroup is not master zonegroup * / if (! get_zonegroup () .is_master) {return false } / * single zonegroup and a single zone * / if (current_period.is_single_zonegroup (cct, this) & & get_zonegroup (). Zones.size () = = 1) {return false;} / * zone is not master * / if (get_zonegroup (). Master_zone.compare (zone_public_config.id)! = 0) {return false;} return true;} solution

The rados command deletes the corresponding obj manually, but note that the corresponding bucket is no longer needed. It is best to confirm the final operation on multiple clusters to ensure data consistency.

Modify the cluster configuration to meet one of the above four requirements.

Finally, non-standard operation to delete bucket may destroy the underlying data consistency, start with no regrets, you must be careful.

After reading the above, have you mastered the details of bucket deletion? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 214

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report