Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760058Ab2JYSaE (ORCPT ); Thu, 25 Oct 2012 14:30:04 -0400 Received: from li9-11.members.linode.com ([67.18.176.11]:57577 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758569Ab2JYSaA (ORCPT ); Thu, 25 Oct 2012 14:30:00 -0400 Date: Thu, 25 Oct 2012 14:29:48 -0400 From: "Theodore Ts'o" To: david@lang.hm Cc: Nico Williams , General Discussion of SQLite Database , =?utf-8?B?5p2o6IuP56uL?= Yang Su Li , linux-fsdevel@vger.kernel.org, linux-kernel , drh@hwaci.com Subject: Re: [sqlite] light weight write barriers Message-ID: <20121025182948.GB16257@thunk.org> Mail-Followup-To: Theodore Ts'o , david@lang.hm, Nico Williams , General Discussion of SQLite Database , =?utf-8?B?5p2o6IuP56uL?= Yang Su Li , linux-fsdevel@vger.kernel.org, linux-kernel , drh@hwaci.com References: <5086F5A7.9090406@vlnb.net> <20121025060231.GC9860@thunk.org> <20121025140327.GB13562@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1296 Lines: 27 On Thu, Oct 25, 2012 at 11:03:13AM -0700, david@lang.hm wrote: > I agree, this is why I'm trying to figure out the recommended way to > do this without needing to do full commits. > > Since in most cases it's acceptable to loose the last few chunks > written, if we had some way of specifying ordering, without having > to specify "write this NOW", the solution would be pretty obvious. Well, using data journalling with ext3/4 may do what you want. If you don't do any fsync, the changes will get written every 5 seconds when the automatic journal sync happens (and sub-4k writes will also get coalesced to a 5 second granularity). Even with plain text files, it's pretty easy to tell whether or not the final record is a partially written or not after a crash; just look for a trailing newline. Better yet, if you are writing to multiple log files with data journalling, all of the writes will happen at the same time, and they will be streamed to the file system journal, minimizing random writes for at least the journal writes. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/