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 B9D94195B6 for ; Mon, 11 Apr 2016 16:11:30 +0000 (UTC) Received: (qmail 85720 invoked by uid 500); 11 Apr 2016 16:11:29 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 85622 invoked by uid 500); 11 Apr 2016 16:11:29 -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 85245 invoked by uid 99); 11 Apr 2016 16:11:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2016 16:11:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0999A180481 for ; Mon, 11 Apr 2016 16:11:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=messagingengine.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 6elAFSDAFfsJ for ; Mon, 11 Apr 2016 16:11:27 +0000 (UTC) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 4BFCE5F237 for ; Mon, 11 Apr 2016 16:11:26 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id A786AAE1 for ; Mon, 11 Apr 2016 12:11:19 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Mon, 11 Apr 2016 12:11:19 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=b86NHKGOnyDw4+0 a72HFgFMlwds=; b=kpv+0ySfokMinmPiLYC24SFGuW/SWNdr27cAUX0AwO8wnA+ Fn4wZTlFjU0VvxX2weW0BwUu7gbtJ3kNAwiQVrjnf5oer8klOyRFmDVa01tKc3WD ZmndJwYO1TXL6cyCT/DU7neSDhXJN70nG09GQEgNHldhSq/mgG8PsHhZLdis= X-Sasl-enc: cH8hw9b6ukXUDIUvl22Fvp+PSrVDLFDjtlMIyosnIwRL 1460391078 Received: from kocolosk.usma.ibm.com (unknown [129.42.208.174]) by mail.messagingengine.com (Postfix) with ESMTPA id 9F9E6680174 for ; Mon, 11 Apr 2016 12:11:18 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [Proposal] Change etag calculation From: Adam Kocoloski In-Reply-To: Date: Mon, 11 Apr 2016 12:11:18 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <11CF5CF6-699E-42AD-BBB7-58B4D29B9C5A@apache.org> References: <27897F20-F439-46E3-B818-127FE25C44D7@akamai.com> <22A0FBF9-50BE-4772-B341-74CDD2D858F4@apache.org> To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.3124) Cool. I=E2=80=99m a little confused about the MD5 for regular docs = discussion. What=E2=80=99s the driving force behind switching away from = revisions as ETags. Is it 1) Users can break this by setting their own revisions 2) Documents with identical bodies but different revisions should be = cacheable In case #1 a user operating at this level potentially breaks quite a bit = more than the caching mechanism, doesn=E2=80=99t she? I=E2=80=99d need = to think through the full ramifications but I=E2=80=99d love to see = investment in the standardization of the revision generation algorithm = as we discussed in a recent thread, and then maybe be a bit more strict = around the revision IDs that we accept with new_edits=3Dfalse. Case #2 also feels broken to me, we probably can=E2=80=99t be returning = documents from a cache with the wrong revision ID. Sorry if I=E2=80=99m missing the crux of the argument here. Adam > On Apr 11, 2016, at 10:43 AM, Garren Smith wrote: >=20 > Thanks for the feedback. For now I will proceed with getting the = _local > fixes then. Then we can look at a performant way of doing the md5 for > regular docs. >=20 > Cheers > Garren >=20 > On Sat, Apr 9, 2016 at 10:18 AM, Robert Newson = wrote: >=20 >> The original patch from garren calculated the md5(body) at query = time. >> This was fine for just local docs since fetching then is rare. >>=20 >> I'm +1 on the proposal and agree we need to precalculate the etag for >> regular docs. >>=20 >>> On 8 Apr 2016, at 19:01, Alexander Shorin wrote: >>>=20 >>>> On Fri, Apr 8, 2016 at 8:55 PM, Mutton, James >> wrote: >>>> Is the proposal to calculate and store the md5 as a meta field, or = to >> calculate md5(_rev, body) at request time? Doing this at request = time >> would be very expensive for heavily loaded servers. >>>=20 >>> Good point and concern. This is not a new meta field, just a Etag >>> header value. And obliviously, there should be the way to not = generate >>> Etag value if it eventually the same as the _rev field value (I = think >>> it's good idea to let them share the same algo). Technically, this >>> could be done by looking on what kind of edit happened: interactive = or >>> not. >>>=20 >>> -- >>> ,,,^..^,,, >>=20 >>=20