Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 2/5] wal: preallocate disk space before writing rows
Date: Tue, 16 Oct 2018 22:09:05 +0300	[thread overview]
Message-ID: <20181016190905.GJ5454@chai> (raw)
In-Reply-To: <600d638cff8abb73a90086a1613733bd089e5ca0.1538942600.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [18/10/08 13:52]:
> This function introduces a new xlog method xlog_fallocate() that makes
> sure that the requested amount of disk space is available at the current
> write position. It does that with posix_fallocate(). The new method is
> called before writing anything to WAL. In order not to invoke a system
> call too often, xlog_fallocate() allocates more than requested.
> 
> The primary reason why I'm doing this is that I want to have a single
> and clearly defined point in the code to handle ENOSPC errors, where I
> could delete old WALs and retry (this is what #3397 is about). I could
> probably handle ENOSPC returned by xlog_tx_commit(), but that would look
> suspicious, because this function can write half a transaction before it
> hits ENOSPC, after which it truncates the file back. It's unclear what
> happens if, for instance, a replication thread reads those transitive
> data.
> 
> Anyway, preallocating disk space in big chunk is a worthwhile feature
> by itself, because it should reduce the number of writes to the inode
> table.

This patch needs to be measured carefully or better yet let's not
do it at all (or find a way to use fallocate() to speed things up,
    not potentially slow them down).

Before we measure this patch we need to measure the general perf.
regression that is currently observable in 1.9+ releases.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  reply	other threads:[~2018-10-16 19:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07 20:27 [PATCH 0/5] Delete old WAL files if running out of disk space Vladimir Davydov
2018-10-07 20:27 ` [PATCH 1/5] xlog: fix filename in error messages Vladimir Davydov
2018-10-12  8:19   ` Vladimir Davydov
2018-10-16 19:07   ` [tarantool-patches] " Konstantin Osipov
2018-10-07 20:27 ` [PATCH 2/5] wal: preallocate disk space before writing rows Vladimir Davydov
2018-10-16 19:09   ` Konstantin Osipov [this message]
2018-10-07 20:27 ` [PATCH 3/5] xlog: allow to limit number of files deleted by xdir_collect_garbage Vladimir Davydov
2018-10-07 20:27 ` [PATCH 4/5] wal: notify watchers about wal file removal Vladimir Davydov
2018-10-07 20:27 ` [PATCH 5/5] wal: delete old wal files when running out of disk space Vladimir Davydov
2018-10-16 19:05 ` [tarantool-patches] Re: [PATCH 0/5] Delete old WAL files if " Konstantin Osipov
2018-10-17  8:20   ` Vladimir Davydov
2018-10-23  8:37     ` Vladimir Davydov
2018-10-23  8:46       ` Konstantin Osipov

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=20181016190905.GJ5454@chai \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 2/5] wal: preallocate disk space before writing rows' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox