[Drbd-dev] [PATCH 1/1] protocol_b_iscsi_timeout

Tejaswini Poluri tpoluri at mvista.com
Thu Nov 19 13:10:23 CET 2015


We have come across a small bug while testing drbd-8.3.16 with iscsi. The
experiment we have done is:

*Primary* : Setup drbd using a loop device
dd if=/dev/zero of=/tmp/test/drbd_disk bs=4K count=6000
losetup /dev/loop0 /tmp/test/drbd_disk
mkfs -t ext3 -b 4096 /dev/loop0
resize2fs /dev/loop0 5143
sleep 2
modprobe drbd
hostname secondary
echo yes|drbdadm create-md r0
drbdadm up r0

*Secondary*:  iscsi disk /dev/sda.
iscsiadm -m discovery -t sendtargets -p
iscsiadm --mode node --targetname iqn.2014.04.com.example:storage_tej.lun2
-p --login
mkfs -t ext3 -b 4096 /dev/sda
resize2fs /dev/sda 5143
sleep 2
mknod /dev/drbd0 b 147 0
hostname secondary
drbdadm create-md r0
drbdadm up r0

*Primary* -
drbdadm -- --overwrite-data-of-peer primary r0
After checking that both the disk states are Uptodate/Uptodate using cat
/proc/drbd , mounted the drbd disk and run the following script.
mount /dev/drbd0 mnt_dir/
cat sync.sh
while true; do date | tee -a /home/root/mnt-dir/c.dat; echo -n A ; sync ;
echo -n B ; sleep 1 ; echo C ; done

with having following timeout values in drbd.conf
net {
    timeout 10;
    ping-int 10;
    ping-timeout 5;
    ko-count 3;

*Test case:*
While running the script, the network of iscsi secondary disk is made down
but the script continuous to run in Primary without recognizing its peer
disk is not up. This happens as the iscsi-disk has a tolerance of 120 sec
and only after which it says that the disk is failed. This delays the drbd
operation and synchronization. This happens only in Protocol B and not in
Protocol C because protocol c checks for WRITE_ACK which doesn't happen
when the disk is not up while the former checks for only RECV_ACK which
happens once the packet is received by peer.

The attached patch resolves the issue and is tested in drbd-8.3.16 and
would be useful for linux-kernel running 2.6 version.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20151119/216918fc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drbd-Protocol-B-timeout-when-secondary-iscsid-disk-f.patch
Type: text/x-patch
Size: 2639 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20151119/216918fc/attachment.bin>

More information about the drbd-dev mailing list