[DRBD-user] syncsource/synctarget

Lars Ellenberg lars.ellenberg at linbit.com
Thu Feb 28 16:14:44 CET 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Thu, Feb 28, 2008 at 09:51:26AM +0100, Papp Tamás wrote:
> Papp Tamás wrote:
> >>
> >>do not use skip-sync.
> >>
> >>it does not skip the initial sync, as you may have assumed,
> >>it does skip _any_ sync.
> >>this was meant as a debug tool in that time, and never to be used in any
> >>production environment.
> >>
> >>do not use skip-sync.
> >>never.
> >>  
> >So there is now way to force a device to be synctarget or syncsource?
> 
> Lars, I would be happy, if you write the best way to solve this problem. 

I know being helpdesk on this list
would be enough for several full time jobs. 
Only, I already have an other one :)

still:

> Until that I write, what worked to me.
> 
> Problem:
> 
> A drbd 0.7 cluster is in split-brain mode and both node was in Primary 
> state. The BAD node wants to be SyncSource, even if its cstate is Secondary.
> 
> Goal: sync bytes from GOOD node to BAD node.
> 
> This behaviour can be seeing by setting '/drbdadm /dev/drbd0 syncer 
> --skip-sync/' and plugging the cross cable:
> 
> # /drbdsetup /dev/drbd0 syncer --skip-sync
> 
> /Plug the cable:/
> 
> /# /cat /proc/drbd/
> version: 0.7.22 (api:79/proto:74) SVN Revision: 2554 build by 
> root at meta1, 2007-06-08 10:51:18
> 0: cs:*SkippedSyncS *st:*Secondary*/Primary ld:Consistent ns:0 nr:379684 
> dw:388896 dr:123304 al:964 bm:1221 lo:0 pe:0 ua:0 ap:0
> 
> 
> Resolving:
> 
> Primary (*BAD*) node change to Secondary:

Primary (*GOOD*) ??

> # /drbdsetup /dev/drbd0 secondary
> 
> /Disconnect the cross cable (maybe here it's enough a /disconnect /command?

probably a good idea to do the disconnect _first_.

> Force *GOOD node *to be *SyncSource* (you can not do it with Secondary):/
> /
> # drbdsetup /dev/drbd0 primary --human

well, actually you can: you can "drbdadm invalidate" the BAD node.
(you'd get a full sync).

or you could manipulate the low level on disk meta data to reset the
generation counters on the BAD node. basically you only have to mark it
as "Inconsistent".
if you feel comfortable doing so, you can search the archive for
"read-gc.pl" and "write-gc.pl" (perl scripts located in the drbd 0.7
tarball in the testing/ subdir). the same can be achieved probably
more reliably using the drbdmeta command from the drbd8 utils.

> For safety set --skip-sync on both nodes (probably unnecessary?):
> 
> # /drbdsetup /dev/drbd0 syncer --skip-sync
> /Plug the cross cable and you have to see something like that on the 
> *BAD* node:
> 
> # /cat /proc/drbd /
> version: 0.7.22 (api:79/proto:74) SVN Revision: 2554 build by 
> root at meta1, 2007-06-08 10:51:18
> 0: cs:*SkippedSyncT *st:Secondary/Secondary ld:Consistent ns:0 nr:379684 
> dw:388896 dr:123304 al:964 bm:1221 lo:0 pe:0 ua:0 ap:0

since you made it Primary above, there should be at least one Primary
here, right?

also, if you fear you may see a sync in the "wrong" direction,
make sure you have the node with the (to the best of your knowledge) GOOD data
in Primary before you reconnect the nodes.
because a Primary will never become SyncTarget, as you have noticed.

> You have the right direction.
> 
> Disconnect nodes and set syncer back to normal behaviour:
> 
> # /drbdsetup /dev/drbd0 disconnect/
> # /drbdsetup /dev/drbd0 syncer/
> 
> Change *GOOD *node to be Primary:
> 
> # drbdsetup /dev/drbd0 primary
> /
> /Connect nodes to start syncing:/
> 
> # drbdsetup /dev/drbd0 connect

should basically work.

-- 
: Lars Ellenberg                           http://www.linbit.com :
: DRBD/HA support and consulting             sales at linbit.com :
: LINBIT Information Technologies GmbH      Tel +43-1-8178292-0  :
: Vivenotgasse 48, A-1120 Vienna/Europe     Fax +43-1-8178292-82 :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list