Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DRBD: Users

Is DRBD not starting if the "Read-Only" flag of block device is set by design or as a bug?

 

 

DRBD users RSS feed   Index | Next | Previous | View Threaded


dimitarboyn at cyclone-trading

May 10, 2012, 6:24 PM

Post #1 of 3 (893 views)
Permalink
Is DRBD not starting if the "Read-Only" flag of block device is set by design or as a bug?

Hi,
I use sparse files to organize a DRBD resource.
I am using build from source drbd-8.4.1.
I use the default commons with device configured as:

[root [at] node ~]# cat /etc/drbd.d/drbd0.res
resource DRBD0 {

syncer {
csums-alg md5;
}
on nodea.cyclone-trading.com {
device /dev/drbd0;
disk /dev/loop0;
address 192.168.150.128:7791;
meta-disk /dev/loop1[0];
}
on nodeb.cyclone-trading.com {
device /dev/drbd0;
disk /dev/loop0;
address 192.168.150.129:7791;
meta-disk /dev/loop1[0];
}
}

The underlying loop devices go to sparse files as follows:
[root [at] node ~]# losetup -a
/dev/loop0: [0802]:791356 (/root/LUN0.sparse)
/dev/loop1: [0802]:791357 (/root/LUN1.sparse)
[root [at] node ~]# ll LUN*
-rw-r--r--. 1 root root 1099511627776 May 9 09:37 LUN0.sparse
-rw-r--r--. 1 root root 134217728 May 9 08:24 LUN1.sparse
[root [at] node ~]# du -h LUN*
423M LUN0.sparse
33M LUN1.sparse


everything works as expected until I down DRBD0 mark loop0 as read-only and
then try to "up" the DRBD0 resource:

[root [at] node ~]# drbdadm down all
[root [at] node ~]# cat /proc/drbd
version: 8.4.1 (api:1/proto:86-100)
GIT-hash: 91b4c048c1a0e06777b5f65d312b38d47abaea80 build by
root [at] NodeA, 2012-05-09 07:39:38

[root [at] node ~]# blockdev --getro /dev/loop0
0
[root [at] node ~]# blockdev --setro /dev/loop0
[root [at] node ~]# blockdev --getro /dev/loop0
1
[root [at] node ~]# drbdadm up DRBD0
0: Failure: (104) Can not open backing device.
Command 'drbdsetup attach 0 /dev/loop0 /dev/loop1 0' terminated with exit
code 10

I will highly appreciate the insight on why using a read-only source is a
problem - once the metadata device is accessible for writes.

Many Thanks!
./Dimitar Boyn


ff at mpexnet

May 11, 2012, 12:49 AM

Post #2 of 3 (866 views)
Permalink
Re: Is DRBD not starting if the "Read-Only" flag of block device is set by design or as a bug? [In reply to]

Hi,

I don't really see what the issue is, but I would definitely like to
bring this back up:

http://lists.linbit.com/pipermail/drbd-user/2011-May/016009.html

So this may end your problems "the other way" ;-)

Cheers,
Felix

On 05/11/2012 03:24 AM, Dimitar Boyn wrote:
> Hi,
> I use sparse files to organize a DRBD resource.
> I am using build from source drbd-8.4.1.
> I use the default commons with device configured as:
>
> [root [at] node ~]# cat /etc/drbd.d/drbd0.res
> resource DRBD0 {
>
> syncer {
> csums-alg md5;
> }
> on nodea.cyclone-trading.com <http://nodea.cyclone-trading.com> {
> device /dev/drbd0;
> disk /dev/loop0;
> address 192.168.150.128:7791 <http://192.168.150.128:7791>;
> meta-disk /dev/loop1[0];
> }
> on nodeb.cyclone-trading.com <http://nodeb.cyclone-trading.com> {
> device /dev/drbd0;
> disk /dev/loop0;
> address 192.168.150.129:7791 <http://192.168.150.129:7791>;
> meta-disk /dev/loop1[0];
> }
> }
>
> The underlying loop devices go to sparse files as follows:
> [root [at] node ~]# losetup -a
> /dev/loop0: [0802]:791356 (/root/LUN0.sparse)
> /dev/loop1: [0802]:791357 (/root/LUN1.sparse)
> [root [at] node ~]# ll LUN*
> -rw-r--r--. 1 root root 1099511627776 May 9 09:37 LUN0.sparse
> -rw-r--r--. 1 root root 134217728 May 9 08:24 LUN1.sparse
> [root [at] node ~]# du -h LUN*
> 423M LUN0.sparse
> 33M LUN1.sparse
>
>
> everything works as expected until I down DRBD0 mark loop0 as read-only
> and then try to "up" the DRBD0 resource:
>
> [root [at] node ~]# drbdadm down all
> [root [at] node ~]# cat /proc/drbd
> version: 8.4.1 (api:1/proto:86-100)
> GIT-hash: 91b4c048c1a0e06777b5f65d312b38d47abaea80 build by
> root [at] NodeA <mailto:root [at] NodeA>,
> 2012-05-09 07:39:38
>
> [root [at] node ~]# blockdev --getro /dev/loop0
> 0
> [root [at] node ~]# blockdev --setro /dev/loop0
> [root [at] node ~]# blockdev --getro /dev/loop0
> 1
> [root [at] node ~]# drbdadm up DRBD0
> 0: Failure: (104) Can not open backing device.
> Command 'drbdsetup attach 0 /dev/loop0 /dev/loop1 0' terminated with
> exit code 10
>
> I will highly appreciate the insight on why using a read-only source is
> a problem - once the metadata device is accessible for writes.
>
> Many Thanks!
> ./Dimitar Boyn
_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


dimitarboyn at cyclone-trading

May 11, 2012, 9:11 AM

Post #3 of 3 (854 views)
Permalink
Re: Is DRBD not starting if the "Read-Only" flag of block device is set by design or as a bug? [In reply to]

Thanks, Felix!
If I may - my question still stands.Two points here:
1. The configuration I posted was for a "2 minutes to reproduce on any
machine" purpose. I have done the same with FC exported LUNs with Read-Only
set on the storage device with the same result.
2. I have read Florian's comment however while entertaining and pointing a
real eventual problem it is not a reason to condemn the concept - sparse
virtual disks are widely used in virtualization and to make things worse
accessed through NFS.
Proper resource planning and making sure how one's application use disk IO
take us a long way and away from contention memory pressure situations.

I have made additional test - instead of using "blockdev" I used "losetup
-r" to set the "read-only" flag on the primary data LUN.
It turns out that this way DRDB does not catch the "read-only" state of the
underlying device and enables the drbd resource allowing it to sync to the
remote target. Of coarse mounting is possible in "ro" mode.

My vote goes to classify this as a bug.
Dimitar

On Fri, May 11, 2012 at 12:49 AM, Felix Frank <ff [at] mpexnet> wrote:

> Hi,
>
> I don't really see what the issue is, but I would definitely like to
> bring this back up:
>
> http://lists.linbit.com/pipermail/drbd-user/2011-May/016009.html
>
> So this may end your problems "the other way" ;-)
>
> Cheers,
> Felix
>
> On 05/11/2012 03:24 AM, Dimitar Boyn wrote:
> > Hi,
> > I use sparse files to organize a DRBD resource.
> > I am using build from source drbd-8.4.1.
> > I use the default commons with device configured as:
> >
> > [root [at] node ~]# cat /etc/drbd.d/drbd0.res
> > resource DRBD0 {
> >
> > syncer {
> > csums-alg md5;
> > }
> > on nodea.cyclone-trading.com <http://nodea.cyclone-trading.com> {
> > device /dev/drbd0;
> > disk /dev/loop0;
> > address 192.168.150.128:7791 <http://192.168.150.128:7791>;
> > meta-disk /dev/loop1[0];
> > }
> > on nodeb.cyclone-trading.com <http://nodeb.cyclone-trading.com> {
> > device /dev/drbd0;
> > disk /dev/loop0;
> > address 192.168.150.129:7791 <http://192.168.150.129:7791>;
> > meta-disk /dev/loop1[0];
> > }
> > }
> >
> > The underlying loop devices go to sparse files as follows:
> > [root [at] node ~]# losetup -a
> > /dev/loop0: [0802]:791356 (/root/LUN0.sparse)
> > /dev/loop1: [0802]:791357 (/root/LUN1.sparse)
> > [root [at] node ~]# ll LUN*
> > -rw-r--r--. 1 root root 1099511627776 May 9 09:37 LUN0.sparse
> > -rw-r--r--. 1 root root 134217728 May 9 08:24 LUN1.sparse
> > [root [at] node ~]# du -h LUN*
> > 423M LUN0.sparse
> > 33M LUN1.sparse
> >
> >
> > everything works as expected until I down DRBD0 mark loop0 as read-only
> > and then try to "up" the DRBD0 resource:
> >
> > [root [at] node ~]# drbdadm down all
> > [root [at] node ~]# cat /proc/drbd
> > version: 8.4.1 (api:1/proto:86-100)
> > GIT-hash: 91b4c048c1a0e06777b5f65d312b38d47abaea80 build by
> > root [at] NodeA <mailto:root [at] NodeA>,
> > 2012-05-09 07:39:38
> >
> > [root [at] node ~]# blockdev --getro /dev/loop0
> > 0
> > [root [at] node ~]# blockdev --setro /dev/loop0
> > [root [at] node ~]# blockdev --getro /dev/loop0
> > 1
> > [root [at] node ~]# drbdadm up DRBD0
> > 0: Failure: (104) Can not open backing device.
> > Command 'drbdsetup attach 0 /dev/loop0 /dev/loop1 0' terminated with
> > exit code 10
> >
> > I will highly appreciate the insight on why using a read-only source is
> > a problem - once the metadata device is accessible for writes.
> >
> > Many Thanks!
> > ./Dimitar Boyn
>

DRBD users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.