Mailing List Archive

drbd test
Hello,
What do you think about that:

#node1: rm /var/lib/drbd/*
#node2: rm /var/lib/drbd/*

#node1 : insmod drbd
#node2 : insmod drbd

#node1 : drbdsetup /dev/nb0 disk /dev/hdc5
#node2 : drbdsetup /dev/nb0 disk /dev/hdc5

#node1 : drbdsetup /dev/nb0 net node1 node2 C -r 12500
#node2 : drbdsetup /dev/nb0 net node2 node1 C -r 12500

#node1 : drbdsetup /dev/nb0 primary
#node1 : mkreiserfs /dev/nb0
#node1 : sync
#node1 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:Connected st:Primary/Secondary ns:32796 nr:0 dw:32796 dr:100
pe:0 ua:0
#node2 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:Connected st:Secondary/Primary ns:0 nr:32796 dw:32796 dr:0
pe:0 ua:0

#node1 : mount /dev/nb0 /mnt/drbd0
#node1 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:Connected st:Primary/Secondary ns:32800 nr:0 dw:32800 dr:100
pe:0 ua:0
#node2 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:Connected st:Secondary/Primary ns:0 nr:32800 dw:32800 dr:0
pe:0 ua:0

#node2 : reboot

#node1 : cp <one file> /mnt/drbd0/file
#node1 : sync
#node1 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:WFConnection st:Primary/Unknown ns:32800 nr:0 dw:33208
dr:32900 pe:0 ua:0
->it seems that 408 blocks were written on /dev/hdc5
#node2 : insmod drbd
#node2 : drbdsetup /dev/nb0 disk /dev/hdc5
#node2 : drbdsetup /dev/nb0 net node2 node1 C -r 12500
#node2 : drbdsetup /dev/nb0 wait_sync
#node2 : sync
#node2 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:Connected st:Secondary/Primary ns:0 nr:400 dw:400 dr:0 pe:0
ua:0
->it seems that ONLY 400 blocks were transmitted to node2 !!!
->i expected 408 ...

#node1 : cat /proc/drbd
version: 0.6.1-pre2 (api:58/proto:58)
0: cs:Connected st:Primary/Secondary ns:33200 nr:0 dw:33208
dr:33300 pe:0 ua:0
->only 400 blocks were send to node2. 408 were written on disk

---> Does it mean that the 2 partners partitions aren't correctly
synchronized when secondary node comes back ? <---

Next i mounted /dev/hdc5 on node2. The partition seemed to be the same
as /dev/hdc5 on node 1 (ls -l exactly the same on /mnt/drbd0 on the 2
nodes)
But i used a tool (debugreiserfs ) which allow me to have a kind of
image of a reiserfs filesystem. (debugreiserfs -p)
I get two files whose size are same, but "cmp file1 file2" shows they
are different !
(Whereas the result is the same if i don't kill node 2)

Bye,

--
Jean-Yves BOUET
EADS Defence and Security Networks
jean-yves.bouet@example.com
01 34 60 86 36
Re: drbd test [ In reply to ]
* Jean-Yves Bouet - 78636 <jean-yves.bouet@example.com> [011010 16:18]:
> Hello,
> What do you think about that:
>
> #node1: rm /var/lib/drbd/*
> #node2: rm /var/lib/drbd/*
>
> #node1 : insmod drbd
> #node2 : insmod drbd
>
> #node1 : drbdsetup /dev/nb0 disk /dev/hdc5
> #node2 : drbdsetup /dev/nb0 disk /dev/hdc5
>
> #node1 : drbdsetup /dev/nb0 net node1 node2 C -r 12500
> #node2 : drbdsetup /dev/nb0 net node2 node1 C -r 12500
>
> #node1 : drbdsetup /dev/nb0 primary
> #node1 : mkreiserfs /dev/nb0
> #node1 : sync
> #node1 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:Connected st:Primary/Secondary ns:32796 nr:0 dw:32796 dr:100
> pe:0 ua:0
> #node2 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:Connected st:Secondary/Primary ns:0 nr:32796 dw:32796 dr:0
> pe:0 ua:0
>
> #node1 : mount /dev/nb0 /mnt/drbd0
> #node1 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:Connected st:Primary/Secondary ns:32800 nr:0 dw:32800 dr:100
> pe:0 ua:0
> #node2 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:Connected st:Secondary/Primary ns:0 nr:32800 dw:32800 dr:0
> pe:0 ua:0
>
> #node2 : reboot
>
> #node1 : cp <one file> /mnt/drbd0/file
> #node1 : sync
> #node1 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:WFConnection st:Primary/Unknown ns:32800 nr:0 dw:33208
> dr:32900 pe:0 ua:0
> ->it seems that 408 blocks were written on /dev/hdc5
> #node2 : insmod drbd
> #node2 : drbdsetup /dev/nb0 disk /dev/hdc5
> #node2 : drbdsetup /dev/nb0 net node2 node1 C -r 12500
> #node2 : drbdsetup /dev/nb0 wait_sync
> #node2 : sync
> #node2 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:Connected st:Secondary/Primary ns:0 nr:400 dw:400 dr:0 pe:0
> ua:0
> ->it seems that ONLY 400 blocks were transmitted to node2 !!!
> ->i expected 408 ...
>
> #node1 : cat /proc/drbd
> version: 0.6.1-pre2 (api:58/proto:58)
> 0: cs:Connected st:Primary/Secondary ns:33200 nr:0 dw:33208
> dr:33300 pe:0 ua:0
> ->only 400 blocks were send to node2. 408 were written on disk

Yes, this is perfectly valid. The things I know about reiserfs are:
*) It uses 4k blocks (always)
*) It uses a 32 MB Journal
*) It can to tail compression (I do not know if this is the right expression)

Probabely reiserfs wrote a record to a journal block (let's assume to block
nr. 4711) then it did a few updates to the on disk data structures, and
then it appended a "done" record to the journal, which happens to be in
4711 again.
to the secondary (4711)

(Also in case of tail compression you would have multiple writes to
a single block, but in your test you had only one file...)

You can watch the same fact with ext2 which has to updates block-group-
descriptor-blocks (I do not know if this is the right expression) and the
super-block quite frequent.

> ---> Does it mean that the 2 partners partitions aren't correctly
> synchronized when secondary node comes back ? <---
>
> Next i mounted /dev/hdc5 on node2. The partition seemed to be the same
> as /dev/hdc5 on node 1 (ls -l exactly the same on /mnt/drbd0 on the 2
> nodes)
> But i used a tool (debugreiserfs ) which allow me to have a kind of
> image of a reiserfs filesystem. (debugreiserfs -p)
> I get two files whose size are same, but "cmp file1 file2" shows they
> are different !

You mentioned that you copied one file to the filesystem, did you compared
that as well ? -- I guess the file itself does not show any defects.

I do not know what debugfeiserfs -p does, but I would use something like
this to verify the operation of drbd:

tar cf - /mountpoint | md5sum

Maybe debugreiserfs included some blocks into its output that where not
cleaned by mkreiserfs. In that case you would have to clean the whole
partition (dd if=/dev/zero of=/dev/device) before making the file system.

-Philipp