[Drbd-dev] [PATCH] drbd-utils: Fix the default node id initialization when upgrade v8 to v9

Lars Ellenberg lars.ellenberg at linbit.com
Fri Jan 13 12:03:45 CET 2017


On Fri, Jan 13, 2017 at 02:15:58PM +0800, Nick Wang wrote:
> Node id will be initialized as "0" in md_convert_08_to_09() when upgrading to drbd9 
> (still using two nodes without changing configuration like expliciting set the node id). 

With DRBD 9, you *have* to set the node id in the configuration.
If there is a way around that, we need to fix it.

Also, IMO, in virtually all 8 -> 9 upgrade scenarios, you are better off
creating new DRBD 9 meta data instead of trying to "convert".

Still; your suggestion seems sensible enough.

Thanks,
    Lars

> diff --git a/user/shared/drbdmeta.c b/user/shared/drbdmeta.c
> index 9a28984..e2a9606 100644
> --- a/user/shared/drbdmeta.c
> +++ b/user/shared/drbdmeta.c
> @@ -3868,6 +3868,7 @@ void md_convert_08_to_09(struct format *cfg)
>  
>  	cfg->md.flags &= ~(MDF_CONNECTED_IND | MDF_FULL_SYNC | MDF_PEER_OUT_DATED);
>  
> +	cfg->md.node_id = -1;
>  	cfg->md.magic = DRBD_MD_MAGIC_09;
>  	re_initialize_md_offsets(cfg);


More information about the drbd-dev mailing list