[sheepdog] [PATCH v5 1/6] zookeeper: fixed concurrent startup error

Liu Yuan namei.unix at gmail.com
Fri Jun 21 12:56:00 CEST 2013


On 06/21/2013 03:00 AM, Kai Zhang wrote:
> +		for (; ; (*master_seq)++) {

This looks weird to me. use a loop and put (*master_seq)++ in the loop
cleaner to me.

> +			snprintf(master_compete_path, len,
> +				 MASTER_ZNONE "/%010"PRId32, *master_seq);
> +			rc = zk_get_data(master_compete_path, master_name,
> +					 &len);
> +			if (rc  == ZOK)
> +				break;

redundant space

> +			else if (rc == ZNONODE) {
> +				sd_iprintf("detect master leave, "
> +					   "start to compete master");
> +				continue;
> +			} else
> +				panic("failed, path:%s, %s",
> +				      master_compete_path, zerror(rc));
> +		}

Thanks,
Yuan



More information about the sheepdog mailing list