[DRBD-user] Behaviour of drbd-secondary

Reine Larsson reine.xa.larsson at ericsson.com
Tue Mar 22 14:53:37 CET 2005


Hi,

After uplifting from 0.6.12 to 0.7.6 we discover a change in behaviour.
When did this change happen?
Is there something that can be done about it?

What we want to do is to read from the secondary (replicated) device.
Note: we are not trying to mount a FS...

In this case we have bound /dev/raw/raw2 to /dev/drbd1 (on drbd 0.6 
/dev/nb1) which is the Secondary.
We start a process that open the raw device for reading, it is a 
replicated databaselog
The dd command works much the same as our process.

0.6.12 environment
==================
So we use dd as an example.

    dd count=10 if=/dev/raw/raw2 of=/export/raw2.dd
    2+0 records in
    2+0 records out
    strace.out: 9177  13:28:41 open("/dev/raw/raw2", 
O_RDONLY|O_LARGEFILE) = 0

dd Successfully opens and reads on a 0.6 drbd device

0.7.6 environment
=================
Doing the same thing on 0.7.6

    dd count=10 if=/dev/raw/raw2 of=/export/raw2.dd
    dd: opening `/dev/raw/raw2': Device or resource busy
    strace.out: 9107  17:28:41 open("/dev/raw/raw2", 
O_RDONLY|O_LARGEFILE) = -1 EBUSY (Device or resource busy)

Reading from a 0.7.6 drbd device is prohibited.
When did this change happen and is there something to do about it?

Kind regards
Reine


==========================================================================
This sequence of commands are issued on both machines (in 0.7 syntax, 
0.6 syntax is similar):
$DRBDSETUP /dev/drbd0 disk $aLogDev $drbdDev 0 -d 2040M
$DRBDSETUP /dev/drbd1 disk $bLogDev $drbdDev 1 -d 2040M
$DRBDSETUP /dev/drbd0 primary
/usr/sbin/raw /dev/raw/raw1 /dev/drbd0
/usr/sbin/raw /dev/raw/raw2 /dev/drbd1
/sbin/drbdsetup /dev/drbd0 net $this_tipct:7789 $peer_tipct:7790 C
/sbin/drbdsetup /dev/drbd1 net $this_tipct:7790 $peer_tipct:7789 C

Resulting in:
# cat /proc/drbd
version: 0.7.6 (api:77/proto:74)
SVN Revision: 1663 build by phil at mescal, 2004-11-29 13:47:11
 0: cs:Connected st:Primary/Secondary ld:Consistent
    ns:2088960 nr:0 dw:0 dr:2088960 al:0 bm:128 lo:0 pe:0 ua:0 ap:0
 1: cs:Connected st:Secondary/Primary ld:Consistent
    ns:0 nr:2088960 dw:2088960 dr:0 al:0 bm:256 lo:0 pe:0 ua:0 ap:0


OS: SLES 9 minimal install
uname -r: 2.6.5.
rpm -q glibc: glibc-2.3.3-98.28
Diskreplication system: drbd 0.7.6
CPU: Intel(R) Celeron(R) CPU 2.20GHz




More information about the drbd-user mailing list