[Openstack] some of my understand of swift object replication (chinese and english)

pf shineyear shinepf at gmail.com
Tue Nov 29 23:57:50 UTC 2011


1。 当 proxy 传输成功节点数量 只有 2 的时候, 谁去补全第三个节点? 怎么补的?

when there is just 2 object server transfer success, who will fill up the
failed one?how?

如果只有三个节点, 两个挂了, 写入失败

if there are 3 object server, 2 node failed, upload fail.

如果只有三个节点, 一个挂了, 三次写入都成功, 另一次失败的写入会被 proxy 转写到 另外的两个节点中的一个, 由于 partition 不同,
所以虽然文件内容相同, 但在同一台机器上是不同的路径, 这样在 replicator 进程中就可以根据 ring
的值判断出某个路径里的文件是不属于这台服务器的, 从而当挂掉的节点恢复后可以被同步。

if there are 3 object server, 1 node failed and 3 times transfer all
success, the one of 3, is uploaded to an available server (one of the 2
available server), because the partition is different , so dir and hash
value is different even in the same machine. so, replicator process will
fine this upload file which not belong this server(scan all files in the
server and use ring file to calculate which file not belong), and when the
failed node become available, it will be rsync back.

如果只有三个节点, 一个挂了, 三次写入只有两次成功, 另一次的写入失败是由于网络原因引起的写入超时, 那么写入的文件是不完整的, auditor
进程会将不完整的文件 rename 到 quarantine 目录以进行文件修复

if there are 3 object server, 1 node failed and 3 times transfer just
successed 2, the failed one because the network problem timeout when it
already transfer some. auditor process will move the not complete file to
quarantine dir to repair it.

2。 通过 hash suffix 来判断文件是否被更改, 怎么判断被更改的时间先后顺序?怎么能肯定是最新的呢?

how to comfirm file changed through hash suffix? how to make sure which
change is the newest one?

通过 proxy server 传递到 object server 上的 x-timestemp 时间来判断, 必须实用 NTP 来同步所有
proxy server 的时间 否则会有一致性问题

when file upload , proxy server will send a x-timestemp http header to
every object server, it’s the current time on proxy server , so use this
timestemp you can find which one is new and which one is old. you must use
NTP server to keep every proxy server have the same time.

here is the response mail about that question from core developer of swift

On Mon, Nov 28, 2011 at 9:04 PM, pf shineyear <shinepf at gmail.com> wrote:
> hi all
> i think X-Timestamp header is come from the proxy servery to object
storage
> node, the value is proxy server current time.
> if i have 2 or more proxy server run in one cluster, should i comfirm same
> "account/container/filename" use same proxy server?
> because if i upload one file 2 times use different proxy server, the
server
> time is different, and i think there maybe have some consistent problem
if i
> do so. am i right??

Yeah, Swift's "last write wins" logic is only as good as proxy server
times are synchronized.  The idea is you'd use NTP or similar to keep
them synced.

And NTP generally does a really good job, with clock skews an order of
magnitude smaller than the time it takes to PUT an object into Swift
(which is about the best conflict resolution level you could hope for
anyways).

We talked a lot about using logical clocks (e.g. vector clocks) when
designing Swift, but realistically they'd probably usually just have
to fall back on timestamps to resolve conflicts.  Or version objects
when there's a conflict and let the client decide which is "right",
and that's a whole mess for both the clients and the backend.

We've also talked about tie breaker ideas, because there's only so
much resolution in those timestamps.  But in reality, it's a pretty
low priority because it's really difficult to exploit and only screws
up the user's own data if they manage it.

- Mike



3。 两个节点同时向一个重启的节点发送同步文件, 不会被覆盖或写花么?

if 2 object server replicator process rsync one file to anothor object
server at same time, how to guarantee file not be cover or overlap write?

通过对目录进行读写锁控制

use fcntl to add the read/write lock to the parent dir.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20111130/46ec76cd/attachment.html>


More information about the Openstack mailing list