All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
To: Paul Jones <paul@pauljones.id.au>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Global reserve and ENOSPC while deleting snapshots on 5.0.9
Date: Tue, 23 Apr 2019 23:58:41 -0400	[thread overview]
Message-ID: <20190424035840.GA11500@hungrycats.org> (raw)
In-Reply-To: <SYCPR01MB508619DDF149E56FAAC7C9D29E3C0@SYCPR01MB5086.ausprd01.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]

On Wed, Apr 24, 2019 at 02:57:47AM +0000, Paul Jones wrote:
> > -----Original Message-----
> > From: linux-btrfs-owner@vger.kernel.org <linux-btrfs-
> > owner@vger.kernel.org> On Behalf Of Zygo Blaxell
> > Sent: Wednesday, 24 April 2019 9:07 AM
> > To: linux-btrfs@vger.kernel.org
> > Subject: Global reserve and ENOSPC while deleting snapshots on 5.0.9
> > 
> > I had a test filesystem that ran out of unallocated space, then ran out of
> > metadata space during a snapshot delete, and forced readonly.
> > The workload before the failure was a lot of rsync and bees dedupe
> > combined with random snapshot creates and deletes.
> > 
> > I tried the usual fix strategies:
> > 
> > 	1.  Immediately after mount, try to balance to free space for
> > 	metadata
> > 
> > 	2.  Immediately after mount, add additional disks to provide
> > 	unallocated space for metadata
> > 
> > 	3.  Mount -o nossd to increase metadata density
> > 
> > #3 had no effect.  #1 failed consistently.
> > 
> > #2 was successful, but the additional space was not used because btrfs
> > couldn't allocate chunks for metadata because it ran out of metadata space
> > for new metadata chunks.
> > 
> > When btrfs-cleaner tried to remove the first pending deleted snapshot, it
> > started a transaction that failed due to lack of metadata space.
> > Since the transaction failed, the filesystem reverts to its earlier state, and
> > exactly the same thing happens on the next mount.  The 'btrfs dev add' in #2
> > is successful only if it is executed immediately after mount, before the btrfs-
> > cleaner thread wakes up.
> 
> I had a similar problem on iirc 4.20, except that I couldn't get the new devices to add (raid1) before the cleaner thread ran, no matter how fast I added them after mount.
> I ended up just commenting out the part that forces the fs to go read only. The cleaner thread exits gracefully (I think?) so then it was no trouble to add the devices.
> 
> Is it still necessary to have the fs go read only like that when it's out of space?

It's definitely a good idea to go read only on generic transaction
failures.

Maybe it's not such a good idea to lump ENOSPC in with other kinds of
transaction failure.

> Paul.
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2019-04-24  3:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 23:06 Global reserve and ENOSPC while deleting snapshots on 5.0.9 Zygo Blaxell
2019-04-24  2:57 ` Paul Jones
2019-04-24  3:58   ` Zygo Blaxell [this message]
2019-06-23 14:14 ` Global reserve and ENOSPC while deleting snapshots on 5.0.9 - still happens on 5.1.11 Zygo Blaxell
2019-06-24 10:01   ` Martin Raiber
2019-06-24 11:36     ` Zygo Blaxell
2019-07-01  3:07   ` Global reserve and ENOSPC while deleting orphan inodes on 5.1.14 Zygo Blaxell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190424035840.GA11500@hungrycats.org \
    --to=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=paul@pauljones.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.