Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A50C8088 for ; Tue, 16 Aug 2011 23:50:15 +0000 (UTC) Received: (qmail 71854 invoked by uid 500); 16 Aug 2011 23:50:14 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 71800 invoked by uid 500); 16 Aug 2011 23:50:14 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 71790 invoked by uid 99); 16 Aug 2011 23:50:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2011 23:50:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of randall.leeds@gmail.com designates 209.85.218.52 as permitted sender) Received: from [209.85.218.52] (HELO mail-yi0-f52.google.com) (209.85.218.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2011 23:50:05 +0000 Received: by yie13 with SMTP id 13so539754yie.11 for ; Tue, 16 Aug 2011 16:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=VGGoIqwIdzD5sLhOiY9dkLXxislRoMaEISoBIfGs+lc=; b=bJJCm0MNkrpJ7cKEpstEurcj6S778ScWaAiN9gKkGcBu+k+e4/0YjY0Q6hfjdBx7+Z P7QX/il+WuxsF4uxfbwExwnIoqYcoKStT4c7qC5VPKDgvBIwxMQWssA4cchHG/AHZlbL 6lLy8Gl+frgLmIv7DOgh6/cJPq0VbCzuV3nyU= MIME-Version: 1.0 Received: by 10.43.49.74 with SMTP id uz10mr156376icb.406.1313538584555; Tue, 16 Aug 2011 16:49:44 -0700 (PDT) Received: by 10.42.218.1 with HTTP; Tue, 16 Aug 2011 16:49:44 -0700 (PDT) In-Reply-To: References: <4E4AB70F.5040302@fiset.ca> Date: Tue, 16 Aug 2011 16:49:44 -0700 Message-ID: Subject: Re: The replicator needs a superuser mode From: Randall Leeds To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=bcaec5299a49bb335604aaa808ca X-Virus-Checked: Checked by ClamAV on apache.org --bcaec5299a49bb335604aaa808ca Content-Type: text/plain; charset=UTF-8 On Tue, Aug 16, 2011 at 16:23, Paul Davis wrote: > On Tue, Aug 16, 2011 at 4:46 PM, Randall Leeds > wrote: > > -1 on _skip_validation and new role > > > > One can always write a validation document that considers the role, no? > Why > > can't users who need this functionality craft a validation function for > this > > purpose? This sounds like a blog post and not a database feature. > > > > +0 on _dump/_load > > > > If it ships raw .couch files I'm totally against it because I think the > HTTP > > API should remain as independent of implementation details as possible. > If > > it is non-incremental I don't see significant benefit, unless it's just > to > > traverse the document index and ignore the sequence index as a way to > skip > > reads, but this seems like a weak argument. If it's incremental, well, > then, > > that's replication, and we already have that. > > > > Think of plain text backups and last resort upgrade paths. Also, it > wouldn't have validation docs run on it or anything of that nature. > I'm thinking basically of having a multipart/mime stream > representation of the database that follows the update sequence. And > the _dump would allow for a ?since= parameter that would make it > incremental. This would even give people the ability to do daily logs > and so on. > Right-o. I don't feel strongly about it, like I said, and think it could be easily crafted as a plugin if we get *that* situation sorted out. How's my assessment of the need for a special role or validation skipping, though? Am I right that one could just create a smart validation function? > > > -Randall > > > > > > On Tue, Aug 16, 2011 at 11:40, Adam Kocoloski > wrote: > > > >> Hi Jean-Pierre, I'm not quite sure I follow that line of reasoning. A > user > >> with _admin privileges on the database can easily remove any validation > >> functions prior to writing today. In my proposal skipping validation > would > >> require _admin rights and an explicit opt-in on a per-request basis. > What > >> are you trying to guard against with those validation functions? Best, > >> > >> Adam > >> > >> On Aug 16, 2011, at 2:29 PM, Jean-Pierre Fiset wrote: > >> > >> > I understand the issue brought by Adam since in our CouchDb > application, > >> there is a need to have a replicator role and the validation functions > skip > >> most of the tests if the role is set for the current user. > >> > > >> > On the other hand, at the current time, I am not in favour of making > >> super users for the sake of replication. Although it might solve the > >> particular problem stated, it removes the ability for a design document > to > >> enforce some "invariant" properties of a database. > >> > > >> > Since there is already a way to allow a "replicator" to perform any > >> changes (role + proper validation function), I do not see the need for > this > >> change. Since the super replicator user removes the ability that a > database > >> has to protect the consistency of its data, and that there does not seem > to > >> be a work-around, I would rather not see this change pushed to CouchDb. > >> > > >> > JP > >> > > >> > On 11-08-16 10:26 AM, Adam Kocoloski wrote: > >> >> One of the principal uses of the replicator is to "make this database > >> look like that one". We're unable to do that in the general case today > >> because of the combination of validation functions and out-of-order > document > >> transfers. It's entirely possible for a document to be saved in the > source > >> DB prior to the installation of a ddoc containing a validation function > that > >> would have rejected the document, for the replicator to install the ddoc > in > >> the target DB before replicating the other document, and for the other > >> document to then be rejected by the target DB. > >> >> > >> >> I propose we add a role which allows a user to bypass validation, or > >> else extend that privilege to the _admin role. We should still validate > >> updates by default and add a way (a new qs param, for instance) to > indicate > >> that validation should be skipped for a particular update. Thoughts? > >> >> > >> >> Adam > >> > > >> > >> > > > --bcaec5299a49bb335604aaa808ca--