From owner-freebsd-hackers@FreeBSD.ORG Tue May 13 12:14:52 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE0A31065674 for ; Tue, 13 May 2008 12:14:52 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id B46D88FC1B for ; Tue, 13 May 2008 12:14:52 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 8B0FD1CC033; Tue, 13 May 2008 05:14:52 -0700 (PDT) Date: Tue, 13 May 2008 05:14:52 -0700 From: Jeremy Chadwick To: Anthony Pankov Message-ID: <20080513121452.GA70860@eos.sc1.parodius.com> References: <9FC19AC2-DAD8-418C-8B9C-F129DEC58CEF@gmail.com> <15336578.20080512123806@mail.ru> <200805121153.00809.jonathan+freebsd-hackers@hst.org.za> <1663320218.20080512223531@mail.ru> <20080512152430.3720683e@mbook.local> <2117635718.20080513154406@mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2117635718.20080513154406@mail.ru> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: BDB corrupt X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2008 12:14:52 -0000 On Tue, May 13, 2008 at 03:44:06PM +0400, Anthony Pankov wrote: > If concurrency is the only problem then: > 1. ?an data corruption be avoided? Or this is impossible? > 2. How? Use Sleepycat/Oracle DB instead? The libc DB1.x, despite being "mature", really should be deprecated in some manner. I'm sure there are others I've forgotten, but the only thing I can think of in the base system which relies on DB1.x is sendmail (which IMHO should really be removed from the base system and replaced with a small standalone mailer -- but that's been discussed in a previous thread in the past). Even "simple" ports like postgrey pull in db41, even though they could technically "work fine" with DB1.x. > If all BDB readers would use O_SHLOCK and all writers O_EXLOCK is it > guarantee for data integrity? The corruption I've seen in the past results in DB operations failing for no particular reason ("what do you mean those are all the records? No! I just inserted a bunch more!"). It turns out some of the data in the actual .db file is corrupt -- even when locking is used everywhere. It's as if the code has some weird bug where it'll write bogus data to the file for some reason. I'll ask you this: is there some particular reason you can't just write to a file yourself, using your own/documented file format? Why does DB have to be used? -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |