On Thu, Aug 23, 2012 at 9:14 PM, MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp> wrote: > At Tue, 21 Aug 2012 22:09:41 +0800, > Yunkai Zhang wrote: >> >> From: Yunkai Zhang <qiushu.zyk at taobao.com> >> >> V2: >> - use '-R, --repair' instread of '-F, --force_repair' >> - not connect to target sheep directly > > This patch still calculates the target nodes in collie, and the > gateway node is only working as a proxy. > > If it is necessary to calculate the targets in collie, I think it's > better to send a SD_OP_TYPE_LOCAL (not SD_OP_TYPE_PEER) request > directly from collie. This patch send SD_OP_CALC_CHKSUM and SD_OP_REPAIR to sheep, they are SD_OP_TYPE_GATEWAY, not SD_OP_TYPE_PEER. What you meant maybe is that let the gateway sheep to collect all the results from other sheeps, I can change this in next version. > >> + >> + /* >> + * Force repair the consistency of oid's replica >> + * >> + * FIXME: this fix is rather dumb, it just read the >> + * first copy and write it to other replica, >> + */ >> + fprintf(stderr, ">> repairing ...\n"); >> + addr_to_str(host, sizeof(host), tgt_vnodes[0]->nid.addr, >> + tgt_vnodes[0]->nid.port); >> + for (i = 1; i < nr_copies; i++) { >> + char dest[128]; >> + addr_to_str(dest, sizeof(dest), tgt_vnodes[i]->nid.addr, >> + tgt_vnodes[i]->nid.port); >> + fprintf(stderr, ">> copy this object from %s => %s\n", >> + host, dest); >> + do_repair(oid, &tgt_vnodes[0]->nid, &tgt_vnodes[i]->nid); >> + } >> + fprintf(stderr, ">> repair finished\n"); >> + return -1; >> } > > The following looks simpler: > - collie sends a SD_OP_REPAIR request to one of the sheep nodes > - the node sends SD_OP_WRITE_PEER requests to the other sheeps to fix > consistency. No problem, I'll give V3 later. > > Thanks, > > Kazutaka -- Yunkai Zhang Work at Taobao |