[英]Are objects in Openstack Swift immediately available?
OpenStack Swift allows replicates and distributes objects in multiple locations over a cluster. OpenStack Swift允许在集群中的多个位置复制和分发对象。
Is it guaranteed that after a successful PUT
operation, i can immediately GET
the object or do I have to wait for the object to propagate over the cluster? 是否可以保证在成功进行
PUT
操作之后,我可以立即GET
对象,还是必须等待对象在群集中传播?
When Swift returns success for a PUT operation, you are guaranteed that it has written quorum (ie (numReplicas / 2) + 1). 当Swift返回成功执行PUT操作时,可以确保它已写入仲裁(即(numReplicas / 2)+1)。 For example, with a 3x replica policy, two replicas will be written before the write request is confirmed.
例如,使用3x副本策略,将在确认写入请求之前写入两个副本。 Since only one replica needs to be available for an object to be read, the object is immediately available .
由于只需要一个副本即可读取对象 ,因此该对象立即可用 。 Remaining replicas are written during the normal object replicator service cycle and placed according to the ring configuration.
其余副本在正常对象复制器服务周期内写入,并根据环配置放置。
As to whether it exists in the container listing, that can be a bit more complicated. 至于它是否存在于容器清单中,则可能要复杂一些。 In the Liberty release, there is a configuration setting called
container_update_timeout
with a default value of 1. That says that if the object server gets confirmations from the container service in less than 1 second, then updates happen synchronously and are guaranteed when success is returned to the client. 在Liberty发行版中,有一个名为
container_update_timeout
的配置设置,其默认值为1。这表示,如果对象服务器在不到1秒的时间内从容器服务获得确认,则更新将同步发生,并在成功返回时确保得到更新。客户端。 However, if the container service takes longer than that, or if the value is set very low (eg 0), then container updates will be bundled together and submitted to the container service asynchronously. 但是,如果容器服务花费的时间更长,或者如果该值设置得很低(例如0),那么容器更新将被捆绑在一起并异步提交给容器服务。
This was done to improve performance in multi-region deployments where the container metadata being updated may not exist in the same data center, or even the same country, as the object service requesting the update. 这样做是为了提高多区域部署中的性能,在这种多区域部署中,要更新的容器元数据可能与请求更新的对象服务不存在于同一数据中心甚至同一国家中。
According to the documentation : 根据文档 :
Suppose a container server is under load and a new object is put in to the system.
假设容器服务器处于负载状态,并且将新对象放入系统中。 The object will be immediately available for reads as soon as the proxy server responds to the client with success .
代理服务器成功响应客户端后,该对象将立即可供读取 。 However, the container server did not update the object listing, and so the update would be queued for a later update.
但是,容器服务器没有更新对象列表,因此该更新将排队等待稍后的更新。 Container listings, therefore, may not immediately contain the object.
因此,容器列表可能不会立即包含该对象。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.