[DRBD-user] confirmed: if you screw up the config, drbd potentially can truncate a live device

Lars Ellenberg lars.ellenberg at linbit.com
Wed Feb 6 12:16:17 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.


intentionally started new thread,
would have been:
 Subject: Re: [DRBD-user] syncing progresses even if devices are of different size?
 In-Reply-To: <20080205110656.GB12537 at pcnocjb.dlan.cinetic.de>

On Tue, Feb 05, 2008 at 12:06:56PM +0100, Jens Beyer wrote:
> 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 ?

confirmed.  aparently there are ways to "truncate" a DRBD by connecting
a smaller DRBD with freshly initialized meta data.
truncating the device file system lives on to a fraction of its size
obviously causes data to become unavailable.

we are working on that.

err. forgot to hit the send button.
and rightly so, some minutes later:
found and fixed.

drbd-8.0.9 is about to be released.  once that is out,
expect this and other fixes to form a 8.2.5 soonish.

cheers.


-- 
: Lars Ellenberg                           http://www.linbit.com :
: DRBD/HA support and consulting             sales at linbit.com :
: LINBIT Information Technologies GmbH      Tel +43-1-8178292-0  :
: Vivenotgasse 48, A-1120 Vienna/Europe     Fax +43-1-8178292-82 :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list