删除 Amazon S3 中尚未传播的对象时会发生什么?
考虑一个仅具有最终一致性的无版本存储桶。
假设我刚刚上传了一个对象,现在我删除了它。删除请求发送到对象尚未传播到的服务器。
现在,在我看来,只有三件事可能发生:
服务器记住删除操作,因此一旦对象到达此服务器就会将其删除。
服务器回复“404 Not found”,对象继续存在。
服务器回复“201 No data”,忘记删除操作,对象继续存在。
答案 1 意味着每个 S3 服务器都必须记住它收到的每个删除请求,以防它稍后从另一台服务器收到相应的对象。重置此内存的唯一方法是整个 S3 集群的某种全局原子同步(因此服务器可以确保它想要忘记的删除没有未完成的更新),我认为这是极不可能的。然而,如果对象稍后仍然出现,则记忆删除的定期超时将破坏最终一致性保证。
另一方面,答案 2 意味着,如果
- 我将对象上传到服务器 A,
- 我会将对象的新版本上传到服务器 B,
- 我会删除服务器 B 上的对象
- 现在,服务器 B 会收到来自服务器的消息关于上传
..所以我最终会得到该对象的过时版本,这破坏了最终的一致性保证。
答案3也意味着最终一致性保证被破坏,因为在发出删除请求后该对象仍然存在。
所以基本上这三个答案似乎同样不可能。我错过了什么吗?
Consider an unversioned bucket with only eventual consistency.
Suppose I just uploaded an object, and now I delete it. The delete request goes to a server to which the object has not yet propagated.
Now, it seems to me, there are just three things that can happen:
The server remembers the delete operation, and will thus remove the object once it arrives at this server.
The server replies with "404 Not found", and the object continues to exist.
The server replies with "201 No data", forgets the delete operation and the object continues to exist.
Answer 1 would imply that every S3 server has to remember every delete request it receives, in case it later receives an the corresponding object from a another server. The only way to reset this memory would be some sort of global atomic sync of the entire S3 cluster (so the server can be sure that there are no outstanding updates for the deletions that it wants to forget), which I consider highly unlikely. A periodic timeout of the memorized removals, however, would break the eventual consistency guarantee if the object still shows up later.
Answer 2, on the other hand, implies that if
- I upload an object to server A
- I upload a new version of the object to server B
- I delete the object on server B
- Only now server B hears from server A about the upload
..so I would end up with an outdated version of the object, which breaks the eventual consistency guarantee.
Answer 3 also means that the eventual consistency guarantee is broken , because the object will still exist after a delete request was issued.
So basically all three answers seem equally unlikely. Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论