From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout.scc.kit.edu (scc-mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id q01GTxJn010689 for ; Sun, 1 Jan 2012 11:29:59 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1RhOII-0004B6-VH; Sun, 01 Jan 2012 17:29:58 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RhOII-0000yr-ST for tech@mdocml.bsd.lv; Sun, 01 Jan 2012 17:29:58 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RhOII-0005qp-QA for tech@mdocml.bsd.lv; Sun, 01 Jan 2012 17:29:58 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1RhOII-0000rh-I3 for tech@mdocml.bsd.lv; Sun, 01 Jan 2012 17:29:58 +0100 Date: Sun, 1 Jan 2012 17:29:58 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: half-atomically rebuild databases Message-ID: <20120101162958.GB5307@iris.usta.de> References: <20120101154538.GA5307@iris.usta.de> <20120101155508.GA4516@britannica.bec.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120101155508.GA4516@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Joerg, Joerg Sonnenberger wrote on Sun, Jan 01, 2012 at 04:55:08PM +0100: > On Sun, Jan 01, 2012 at 04:45:38PM +0100, Ingo Schwarze wrote: >> This is not perfect because the mandocdb process might get -KILLed >> between the two renames, but i don't see a syscall anywhere to >> atomically rename *two* files. > Why do you have to? There are two files to rename(2): whatis.{db,index}. > You can create the new file under temporary name in > the same directory and rename it to the normal file name. That's exactly what the patch i sent does: Creating both files under temporary names in the same directory and rename both to the normal file names when both are ready. Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv