[tarantool-patches] Re: [PATCH 2/5] wal: preallocate disk space before writing rows

Konstantin Osipov kostja at tarantool.org
Tue Oct 16 22:09:05 MSK 2018

* Vladimir Davydov <vdavydov.dev at 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

More information about the Tarantool-patches mailing list