[sheepdog] [PATCH v4 08/12] gateway: don't skip start_recovery for gateway-only node
Liu Yuan
namei.unix at gmail.com
Mon May 27 18:21:52 CEST 2013
On 05/28/2013 12:10 AM, MORITA Kazutaka wrote:
> At Mon, 27 May 2013 23:04:18 +0800,
> Liu Yuan wrote:
>>
>> On 05/27/2013 10:53 PM, MORITA Kazutaka wrote:
>>> I think we should set rinfo->state to RW_NOTIFY_COMPLETION to skip
>>> gathering object lists.
>>
>> I tried so, but can't pass 63. I don't investigate it yet.
>
> It is because rinfo is not freed and 'cluster node recovery' doesn't
> say that the gateway node finishes recovery.
>
> I didn't come up with a clean approach, but it looks the simplest way
> to me to exit prepare_object_list() without sending SD_OP_GET_OBJ_LIST
> when the node is gateway.
>
>
> diff --git a/sheep/recovery.c b/sheep/recovery.c
> index 5fad1fa..9c9acc1 100644
> --- a/sheep/recovery.c
> +++ b/sheep/recovery.c
> @@ -739,6 +739,11 @@ static void screen_object_list(struct recovery_list_work *rlw,
> xqsort(rlw->oids, rlw->count, obj_cmp);
> }
>
> +static inline bool node_is_gateway_only(void)
> +{
> + return sys->this_node.nr_vnodes == 0;
> +}
> +
> /* Prepare the object list that belongs to this node */
> static void prepare_object_list(struct work *work)
> {
> @@ -752,6 +757,9 @@ static void prepare_object_list(struct work *work)
> int start = random() % cur_nr, i, end = cur_nr;
> uint64_t *oids;
>
> + if (node_is_gateway_only())
> + return;
> +
gateway node doesn't need to get_vdis()?
Thanks,
Yuan
More information about the sheepdog
mailing list