[DRBD-user] syncing progresses even if devices are of different size?

Jens Beyer jbe at webde.de
Tue Feb 5 12:06:56 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.


Hi,

On Thu, Jan 10, 2008 at 02:14:06AM +0100, Lars Ellenberg wrote:
> On Wed, Jan 09, 2008 at 04:44:51PM +0100, Tomasz Chmielewski wrote:
> > I just noticed that it is possible to sync a bigger device to a smaller 
> > device (i.e., drbd will sync a 500 GB device onto a 450 GB device).
> > 
> > 
> > drbd_receiver.c will even warn us of a "considerable difference", but 
> > the sync will progress:
> > 
> > 
> > /* warn if the arguments differ by more than 12.5% */
> > static void warn_if_differ_considerably(struct drbd_conf *mdev,
> >         const char *s, sector_t a, sector_t b)
> > {
> >         sector_t d;
> >         if (a == 0 || b == 0)
> >                 return;
> >         d = (a > b) ? (a - b) : (b - a);
> >         if ( d > (a>>3) || d > (b>>3))
> >                 WARN("Considerable difference in %s: %llus vs. %llus\n", s,
> >                      (unsigned long long)a, (unsigned long long)b);
> > }
> > 
> > 
> > 
> > What's the point in trying to synchronize a bigger device on a smaller one?
> > 
> > Just asking, perhaps there are some valid uses.
> 
> cat /proc/partitions
> 
> if you configure drbd, and for some reason have one node with 450GB,
> the other node with 500GB, then drbd will of course know that it can
> only use the minimum.
> 
> mainly its just convenience for you, we don't force you to configure
> exactly identically sized backing store.
> differences of some sectors or even tracks can be seen often.  that is
> why drbd only warns you when it thinks you maybe did not mean to waste
> those 50GB. but if you want to, its up to you.
> maybe you have two vgs with different pe size, and the older does not
> align with the newer one, you introduce drbd after the fact etc...
> 

... but: 

while testing scenarios for migration from non-drbd to drbd we found
that if I have a primary (97GB mounted, XFS) and connect the secondary (10GB, 
which has 'Considerable difference in lower level device sizes..'), we get the
mentioned warning - but from now on the primary is corrupted (unusable):
first xfs gets a forced shutdown and a remount is not possible.

Both devices had freshly created metadata, using drbd-8.2.4 (same for 8.0.x).

Im not sure why the checks in receive_sizes() didnt work to protect 
primary data. Any idea ?

Jens

Dmesg of primary:
[880757.140000] drbd: module cleanup done.
[880760.470000] drbd: initialised. Version: 8.2.4 (api:88/proto:86-88)
[880760.470000] drbd: GIT-hash: fc00c6e00a1b6039bfcebe37afa3e7e28dbd92fa build by root at boxfe01, 2008-01-25 09:31:14
[880760.470000] drbd: registered as block device major 147
[880760.470000] drbd: minor_table @ 0xeed16b40
[880774.210000] drbd2: disk( Diskless -> Attaching ) 
[880774.230000] drbd2: No usable activity log found.
[880774.230000] drbd2: max_segment_size ( = BIO size ) = 32768
[880774.230000] drbd2: drbd_bm_resize called with capacity == 201326592
[880774.230000] drbd2: resync bitmap: bits=25165824 words=786432
[880774.230000] drbd2: size = 96 GB (100663296 KB)
[880774.260000] drbd2: reading of bitmap took 3 jiffies
[880774.260000] drbd2: recounting of set bits took additional 0 jiffies
[880774.260000] drbd2: 0 KB (0 bits) marked out-of-sync by on disk bit-map.
[880774.260000] drbd2: disk( Attaching -> UpToDate ) 
[880774.260000] drbd2: Writing meta data super block now.
[880793.530000] drbd2: role( Secondary -> Primary ) 
[880793.530000] drbd2: Creating new current UUID
[880793.530000] drbd2: Writing meta data super block now.
[880853.310000] Filesystem "drbd2": Disabling barriers, not supported by the underlying device
[880853.310000] XFS mounting filesystem drbd2
[880853.310000] Ending clean XFS mount for filesystem: drbd2
[881304.140000] drbd2: conn( StandAlone -> Unconnected ) 
[881304.140000] drbd2: receiver (re)started
[881304.140000] drbd2: conn( Unconnected -> WFConnection ) 
[881313.090000] drbd2: Handshake successful: Agreed network protocol version 88
[881313.090000] drbd2: conn( WFConnection -> WFReportParams ) 
[881313.090000] drbd2: data-integrity-alg: <not-used>
[881313.090000] drbd2: Considerable difference in lower level device sizes: 20971520s vs. 201326592s
[881313.090000] drbd2: drbd_bm_resize called with capacity == 20971520
[881313.090000] drbd2: resync bitmap: bits=2621440 words=81920
[881313.090000] drbd2: size = 10 GB (10485760 KB)
[881313.100000] drbd2: writing of bitmap took 1 jiffies
[881313.100000] drbd2: 144 KB (36 bits) marked out-of-sync by on disk bit-map.
[881313.100000] drbd2: Writing meta data super block now.
[881313.100000] drbd2: Becoming sync source due to disk states.
[881313.100000] drbd2: Writing meta data super block now.
[881313.100000] drbd2: writing of bitmap took 0 jiffies
[881313.100000] drbd2: 10 GB (2621440 bits) marked out-of-sync by on disk bit-map.
[881313.100000] drbd2: Writing meta data super block now.
[881313.100000] drbd2: peer( Unknown -> Secondary ) conn( WFReportParams -> WFBitMapS ) pdsk( DUnknown -> Inconsistent ) 
[881314.010000] drbd2: Writing meta data super block now.
[881314.020000] drbd2: conn( WFBitMapS -> SyncSource ) 
[881314.020000] drbd2: Began resync as SyncSource (will sync 10485760 KB [2621440 bits set]).
[881314.020000] drbd2: Writing meta data super block now.
[881416.860000] attempt to access beyond end of device
[881416.860000] drbd2: rw=17, want=100663333, limit=20971520
[881416.860000] I/O error in filesystem ("drbd2") meta-data dev drbd2 block 0x6000022       ("xlog_iodone") error 5 buf count 1536
[881416.860000] xfs_force_shutdown(drbd2,0x2) called from line 960 of file fs/xfs/xfs_log.c.  Return address = 0xf0e2f4ec
[881416.860000] Filesystem "drbd2": Log I/O Error Detected.  Shutting down filesystem: drbd2
[881416.860000] Please umount the filesystem, and rectify the problem(s)
[881500.430000] xfs_force_shutdown(drbd2,0x1) called from line 423 of file fs/xfs/xfs_rw.c.  Return address = 0xf0e2f4ec
[881500.430000] xfs_force_shutdown(drbd2,0x1) called from line 423 of file fs/xfs/xfs_rw.c.  Return address = 0xf0e2f4ec
[881504.930000] Filesystem "drbd2": Disabling barriers, not supported by the underlying device
[881504.930000] attempt to access beyond end of device
[881504.930000] drbd2: rw=0, want=201326592, limit=20971520
[881504.930000] I/O error in filesystem ("drbd2") meta-data dev drbd2 block 0xbffffff       ("xfs_read_buf") error 5 buf count 512
[881504.930000] XFS: size check 2 failed

-- 
Dr. Jens Beyer
IT-Systemarchitekt

1&1 Internet AG
Brauerstrasse 48 - D-76135 Karlsruhe
Tel. +49-721-91374-4245
jens.beyer at 1und1.de - http://1und1.de

Amtsgericht Montabaur HRB 6484
Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Andreas Gauger,
Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Achim Weiss 
Aufsichtsratsvorsitzender: Michael Scheeren




More information about the drbd-user mailing list