linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: "Holger Hoffstätte" <holger@applied-asynchrony.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Please disable balance auto-resume for 4.9 (or even 4.8)
Date: Thu, 25 Aug 2016 07:32:25 -0400	[thread overview]
Message-ID: <94acabb3-03c2-fc93-60c6-af55d67b0b5e@gmail.com> (raw)
In-Reply-To: <57BEBC92.2040404@applied-asynchrony.com>

On 2016-08-25 05:38, Holger Hoffstätte wrote:
>
> Automatically resuming an interrupted balance has repeatedly caused all
> sorts of problems because it creates a possible failure mode when a user
> can least use it: after a crash/power loss/sudden reboot (which, like it
> or not, is the de facto "fix random problems" approach for many people).
>
> The idea behind the automnatic resume is good and important for cases
> like automation and unattended operation, but nevertheless right now
> it creates more problems than it fixes.
I would tend to agree.

If the system crashed in the middle of a balance, then we can't assume 
it was something other than the filesystem being balanced that caused 
the crash.  Resuming a balance in such a situation is risky and could 
even trigger another crash (yes, I've actually seen this happen, and it 
was a serious pain to debug).  If the balance was paused so the system 
could reboot with the intent of resuming it later, then the user knows 
they did this, and should be more than capable of resuming it themself. 
I've gotten to the point that all of the filesystems I manage have 
'skip_balance' in their mount options to avoid all the issues I've had, 
and because resuming a balance on a filesystem which is mounted on boot 
can insanely slow down the boot process.
>
> As far as I can see it should be easy enough to simply disable calling
> btrfs_resume_balance_async() at least on mount (in open_ctree()) and
> possibly on remount as well. The skip_balance flag could then simply
> be ignored or removed.
>
> I can't say how much work it would be to completely remove the persistent
> balance state or whether it is useful to be kept around for resume, but at
> least not continuing would stop filesystems from eating themselves further
> on mount.
I think we should keep the persistent balance state, it has on multiple 
occasions been useful to me (running a balance, power loss or some other 
condition requiring shutdown imminent, so I paused, shutdown, and then 
resumed after reboot), and removing it completely may break some things.

Personally, I think we should add an option to force resuming a balance 
on mount (resume_balance maybe?), and then switch to skip_balance being 
default.  This would allow people who still want the auto-resume 
behavior to keep it, while making the defaults safer.

      reply	other threads:[~2016-08-25 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25  9:38 Please disable balance auto-resume for 4.9 (or even 4.8) Holger Hoffstätte
2016-08-25 11:32 ` Austin S. Hemmelgarn [this message]

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=94acabb3-03c2-fc93-60c6-af55d67b0b5e@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=holger@applied-asynchrony.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).