Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9CE0310966 for ; Tue, 23 Apr 2013 20:50:06 +0000 (UTC) Received: (qmail 78546 invoked by uid 500); 23 Apr 2013 20:50:05 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 78493 invoked by uid 500); 23 Apr 2013 20:50:05 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 78483 invoked by uid 99); 23 Apr 2013 20:50:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Apr 2013 20:50:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Apr 2013 20:49:59 +0000 Received: by mail-ob0-f172.google.com with SMTP id v19so897589obq.3 for ; Tue, 23 Apr 2013 13:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=GKfkCe9yfr2H5WmJqHQf7uvUQf5QgfpD3D2wA8zsKHA=; b=jxG2AosyyTdRyzchoyy6YyNz6AoeAO3EW16hKgheUIvTqDgQ5lzR/y2+622UWevd46 rbMNSVwPD6gSIpotydR4ey+9pRJRzX4IVyzKlIAzTMFHEJ1fL1DOXXr4EApWUuRZ+F/T 0c1yWgbToStSdCQMOwJ5iPAJXNcOY+BRltC0ZLfblxORrr2YnJt70EZ3scJxNOaOHJ7w J23xIZbUCS2uyR/Lt6fmpUhXOa2XHkI8CiV+UCyACtK6AuS4eKKuZd/RXM+fDZCF57lV Qj5D2Yi0eDea39aevIfbALvr8CzBfWTBWA1sVJmUg6AwOY3iSeyfRz3HY+LZof9zEyR1 gVMg== X-Received: by 10.182.226.136 with SMTP id rs8mr17410284obc.50.1366750178390; Tue, 23 Apr 2013 13:49:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.160.194 with HTTP; Tue, 23 Apr 2013 13:48:58 -0700 (PDT) In-Reply-To: <09121212-0E75-4E82-A121-3DD8DBA2D2AB@van-cuijk.nl> References: <55CCE097-9D63-4E28-8873-698AB57822E8@van-cuijk.nl> <09121212-0E75-4E82-A121-3DD8DBA2D2AB@van-cuijk.nl> From: Paul Davis Date: Tue, 23 Apr 2013 15:48:58 -0500 Message-ID: Subject: Re: Questions on durability To: "user@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Apr 23, 2013 at 3:42 PM, Mark van Cuijk wrote: > Thank you both for your answers! > > On Apr 23, 2013, at 22:06 , Paul Davis wrot= e: > >>> 1. Can I access the continuous changes feed on each of the servers and = will those feeds serve the same events in the same order? >> >> Yes to the first half. Individual nodes will have their own changes >> feeds which you can listen to. To the second half, you shouldn't rely >> on that. > > The first part is actually a requirement, the second part is optional. Th= ere's no need to check this, we just shouldn't assume equal ordering when m= onitoring those feeds. > Exactly. >>> 2. Will each server only send events to the changes feed after the data= is durably persisted to hardware storage? >> >> Assuming you turn of delayed_commits and don't disable the fsyncs >> before and after header writes, then yes you're guaranteed to be >> reading changes from an MVCC snapshot which (given a proper config) >> would be guaranteed to be on disk. > > I've read up on delayed_commits and this makes perfect sense. Are there a= ny particular configuration options you are referring to with the phrase "g= iven a proper config" or will it be enough to read up on documentation and = use common sense? > Off the top of my head "proper config" for you would just require disabling delayed commits and not disabling the fsync defaults. Beyond that you should be good to go. >>> 3. The batch=3Dok parameter influences the response to the writing clie= nt, but does it have any influence regarding the answer to the previous que= stion? >>> >> >> No. batch=3Dok is more or less a fire-and-forget approach to writing >> documents. The client basically gets a notification that the document >> parsed ok but has not yet been written. The changes feed still won't >> see it till it gets through the database updater process which is >> exactly the same process as above. > > That's exactly what we're looking for. In fact, this behaviour allows us = to accept the relaxed durability guarantees of batch=3Dok, because we'll on= ly rely on the changes feed to decide what documents are durably stored. Ou= r architecture will be capable of recovering from server failures in the cr= itical components. > Bob and I were discussing this on IRC and realized our answers were a bit conflicting. It sounds like you got it, but for posterity the important bits are this: A client submitting a batch=3Dok write request will get an Accepted response before the doc is durably written to disk. A client reading the _changes feed won't see a write until after it was written durably to disk. > Thanks, > Mark