public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Srikanth C S <srikanth.c.s@oracle.com>
Cc: "linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: Question: Is growing log size when filesystem is grown a feasible solution
Date: Fri, 8 Dec 2023 10:17:41 +1100	[thread overview]
Message-ID: <ZXJSlbgfg70d8Bqo@dread.disaster.area> (raw)
In-Reply-To: <CY8PR10MB72412C0E92BBB12726E3A6C0A38BA@CY8PR10MB7241.namprd10.prod.outlook.com>

On Thu, Dec 07, 2023 at 09:17:09AM +0000, Srikanth C S wrote:
> Hi all,
> 
> We had earlier seen a few instances where there was an impact
> in the read/write performance with processes stuck in
> xlog_grant_head_wait(). And our investigation brought us to the
> conclusion that the limitation in log space was causing this.
> This was when we have a lot of read/write going through and the
> log space was limited.
> 
> The problem was seen especially when the file system was small
> initially and later grown to a larger size using xfs_growfs.
> The log size does not grow when the FS is grown. In these cases,
> we are stuck with the same log size calculated for the smaller
> file system size (which was 10MB, the earlier default value).
> 
> The problem was partially addressed by the commit:
> cdfa467 mkfs: increase the minimum log size to 64MB when possible
> 
> This commit make the default log size to 64MB for new filesystems,
> but does not address the issue for existing filesystems with a
> small log size. The only solution for such Fs is to recreate it
> from scratch, which is not feasible for production systems. Hence,
> there is a need to provide a solution - and we want to explore
> possibility of growing the log size using xfs_growfs.
> 
> It would be great if I can get some comments from the community
> if the change where xfs_growfs can grow the log is encouraged.
> If it is, then any advice or comments on how to proceed with the
> problem would be great too.

It's possible to implement an online log resize. That doesn't mean
it is easy to do. Start thinking about all the failure modes and how
to reliably avoid and/or recover from such failures.

e.g. how do you do an atomic swap from the old log to the new log in
a way that if we crash in the middle of the operation then log
recovery on the next mount will result in either the original state
on the old journal (nothing has changed) or that full operation
completion occurs (running on a fully initialised new journal).

Doing it offline is simpler, but there's still a bunch of metadata
modifications that have to be done correctly. i.e. we still have to
handle the case that the system could crash half way through the
offline log move operation in a manner that doesn't trash the
filesystem or user data.

If you've got 6 months to a year to spend getting all this right,
then I don't think anyone if going to say not to being able to
resize logs and/or convert internal/external logs dynamically. It's
just a lot of work to make it robust and reliable....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2023-12-07 23:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  9:17 Question: Is growing log size when filesystem is grown a feasible solution Srikanth C S
2023-12-07 23:17 ` Dave Chinner [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=ZXJSlbgfg70d8Bqo@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=srikanth.c.s@oracle.com \
    /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