手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

OpenStack Swift 云存储技术详解

[日期:2013-08-01] 来源:cnblogs.com  作者:余兴超 [字体:大 中 小]

3. The Account Reaper 账号收割器

The Account Reaper removes data from deleted accounts in the background.

账号收割器运行在后台从要被删除账号中移除数据。

An account is marked for deletion by a reseller through the services server’s remove_storage_account XMLRPC call. This simply puts the value DELETED into the status column of the account_stat table in the account database (and replicas), indicating the data for the account should be deleted later. There is no set retention time and no undelete; it is assumed the reseller will implement such features and only call remove_storage_account once it is truly desired the account’s data be removed.

通过服务器的remove_storage_account的XMLRPC调用,账号被reseller标记为删除。这一行为简单地将值DELETED放入到账号数据库(和副本)的表account_stat的status列;表示账号数据未来将被删除。没有保留时间和取消删除的设置;它假设reseller将会实现这样的特性并且一旦调用remove_storage_account,该账号的数据就真地被移除。

The account reaper runs on each account server and scans the server occasionally for account databases marked for deletion. It will only trigger on accounts that server is the primary node for, so that multiple account servers aren’t all trying to do the same work at the same time. Using multiple servers to delete one account might improve deletion speed, but requires coordination so they aren’t duplicating effort. Speed really isn’t as much of a concern with data deletion and large accounts aren’t deleted that often.

账号收割器运行在每个账号服务器上,不定期地扫描服务器的账号数据库中标记为删除的数据。它仅会在当前服务器为主节点的账号上触发,因此多个账号服务器并不都尝试着在相同时间内做相同的工作。使用多个服务器来删除一个账号可能会提升删除的速度,但是需要协作以避免重复删除。实际上,在数据删除的速度上并没有给予过多的关注,因为大多数账号并没有那么频繁地被删除。

The deletion process for an account itself is pretty straightforward. For each container in the account, each object is deleted and then the container is deleted. Any deletion requests that fail won’t stop the overall process, but will cause the overall process to fail eventually (for example, if an object delete times out, the container won’t be able to be deleted later and therefore the account won’t be deleted either). The overall process continues even on a failure so that it doesn’t get hung up reclaiming cluster space because of one troublesome spot. The account reaper will keep trying to delete an account until it eventually becomes empty, at which point the database reclaim process within the db_replicator will eventually remove the database files.

删除账号的过程是相当直接的。对于每个账号中的容器,每个对象先被删除然后容器被删除。任何失败的删除请求将不会阻止整个过程,但是将会导致整个过程最终失败(例如,如果一个对象的删除超时,容器将不能被删除,因此账号也不能被删除)。整个处理过程即使遭遇失败也继续执行,这样它不会因为一个麻烦的问题而中止恢复集群空间。账号收割器将会继续不断地尝试删除账号直到它最终变为空,此时数据库在db_replicator中回收处理,最终移除这个数据库文件。

3.1 History 发展史

At first, a simple approach of deleting an account through completely external calls was considered as it required no changes to the system. All data would simply be deleted in the same way the actual user would, through the public ReST API. However, the downside was that it would use proxy resources and log everything when it didn’t really need to. Also, it would likely need a dedicated server or two, just for issuing the delete requests.

最初的时候,一个通过完全地外部调用来删除帐号的简单方法被考虑因为它不需要对系统改变。实际的用户可以通过公共的ReST的API以相同的方式来简易地删除所有的数据。然而,坏处是因为它将使用代理的资源并且记录任何信息即使是不需要的日志。此外,它可能需要一个或两个专用的服务器,仅分配给处理删除请求。

A completely bottom-up approach was also considered, where the object and container servers would occasionally scan the data they held and check if the account was deleted, removing the data if so. The upside was the speed of reclamation with no impact on the proxies or logging, but the downside was that nearly 100% of the scanning would result in no action creating a lot of I/O load for no reason.

一个完全地自底向下的方法也被考虑过,其中对象和容器服务器将不定期地扫面它们的数据并且检测是否该对象被删除了,如果是的话就删除它的数据。好处是回收的速度对于代理或日志没有影响,不过坏事是几乎100%的扫描将会导致无端地没有活动地造成大量的I/O负载。

A more container server centric approach was also considered, where the account server would mark all the containers for deletion and the container servers would delete the objects in each container and then themselves. This has the benefit of still speedy reclamation for accounts with a lot of containers, but has the downside of a pretty big load spike. The process could be slowed down to alleviate the load spike possibility, but then the benefit of speedy reclamation is lost and what’s left is just a more complex process. Also, scanning all the containers for those marked for deletion when the majority wouldn’t be seemed wasteful. The db_replicator could do this work while performing its replication scan, but it would have to spawn and track deletion processes which seemed needlessly complex.

一个容器服务器中心的方法也曾被考虑,其中账号服务器将会标记所有的要被删除的容器,然后容器服务器将会删除每个容器中的对象接着删除容器。这对于带有大量容器的账号的快速回收大有裨益,但坏处是有相当大的负载峰值。该过程可以被放缓来减轻负载峰值的可能性,不过那样的话快速回收的优点就丧失了并且剩下的只是更复杂的过程。同样的,扫描所有的容器中标记来删除的当大多数的将不会视为浪费的。db_replicator可以在执行复制扫面时完成这些工作,但是它将不得产生和记录删除过程这些看起来不必要的复杂性。

In the end, an account server centric approach seemed best, as described above.

最后如上所述,账号服务器中心方法看起来是最佳的。

linux
相关资讯       Swift  OpenStack Swift 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款