From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 24 Oct 2018 20:08:23 +0300 From: Konstantin Osipov Subject: Re: [PATCH v3 1/5] wal: preallocate disk space before writing rows Message-ID: <20181024170823.GI12973@chai> References: <2b1b6e6c39cff3952dda76a482e0960ba0b5a943.1540388352.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2b1b6e6c39cff3952dda76a482e0960ba0b5a943.1540388352.git.vdavydov.dev@gmail.com> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [18/10/24 16:43]: > 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, see wal_fallocate(). In order not > to invoke the system call too often, wal_fallocate() allocates disk > space in big chunks (1 MB). > > The 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). > > Needed for #3397 Thank you for taking into account the comments. Please push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov