From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 01F542B7D7 for ; Tue, 16 Oct 2018 15:09:08 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WkmnpB3YAqO7 for ; Tue, 16 Oct 2018 15:09:07 -0400 (EDT) Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 6289F2B63F for ; Tue, 16 Oct 2018 15:09:07 -0400 (EDT) Received: from [185.6.245.178] (port=50588 helo=atlas.local) by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1gCUiH-0001ey-VW for tarantool-patches@freelists.org; Tue, 16 Oct 2018 22:09:06 +0300 Date: Tue, 16 Oct 2018 22:09:05 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 2/5] wal: preallocate disk space before writing rows Message-ID: <20181016190905.GJ5454@chai> References: <600d638cff8abb73a90086a1613733bd089e5ca0.1538942600.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <600d638cff8abb73a90086a1613733bd089e5ca0.1538942600.git.vdavydov.dev@gmail.com> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org * Vladimir Davydov [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