Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 63882 invoked from network); 25 Mar 2011 20:25:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2011 20:25:36 -0000 Received: (qmail 65249 invoked by uid 500); 25 Mar 2011 20:25:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 65216 invoked by uid 500); 25 Mar 2011 20:25:35 -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 65208 invoked by uid 99); 25 Mar 2011 20:25:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 20:25:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,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.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 20:25:28 +0000 Received: by iwn6 with SMTP id 6so2084457iwn.11 for ; Fri, 25 Mar 2011 13:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=7gqThZb6X6Qn2FNspSaXvxq1MzkjzOf67mxFVXdtATM=; b=CrO8L5d1mED5LbpDRFdihJwAmsY1G1773dCjlxUqbNcIaNB8mMC1fqRTaFrPq1i/jR 3zG1lCDMiB5aH9TenHkquacVhkYXnRwrerUbmEiAC39BAehtp/60aVlCFCNLNTYKqYuN lAbwj8gUaUQRP9nPZhr89EBWo54fMHIwinWSg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dfgueFNKXn5ugTuNpKihGpkjPMySy53pzKKkGTW/kZyRtcJ1fS6Hq8LX77G655sCUl vrSt4QAWzmPnJAyVGksroe/mVhQQxybPHmtDS/pBzt/om9oB+VNCh5dv6NlSZHK2H6qN CIgBPQ+1K98W37gyDxpViLbWMuC35R1RORkAA= MIME-Version: 1.0 Received: by 10.42.146.196 with SMTP id k4mr1991305icv.105.1301084707887; Fri, 25 Mar 2011 13:25:07 -0700 (PDT) Received: by 10.42.98.12 with HTTP; Fri, 25 Mar 2011 13:25:07 -0700 (PDT) In-Reply-To: <4D8CF928.9000506@databill.com> References: <4D8CF928.9000506@databill.com> Date: Fri, 25 Mar 2011 13:25:07 -0700 Message-ID: Subject: Re: What causes compaction to retry? From: Randall Leeds To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Mar 25, 2011 at 13:20, Wayne Conrad wrote: > I've got a largish database that is being both compacted and synchronized > concurrently. > > $ curl --silent topaz:5984/_active_tasks | prettify_json.rb > [ > =C2=A0{ > =C2=A0 =C2=A0"pid": "<0.313.0>", > =C2=A0 =C2=A0"type": "Replication", > =C2=A0 =C2=A0"task": "`874dbdaf26454065f33007eb42c8320a+create_target`: > `http://sodium:5984/incoming/` -> `incoming`", > =C2=A0 =C2=A0"status": "Processed source seq 477428" > =C2=A0}, > =C2=A0{ > =C2=A0 =C2=A0"pid": "<0.24865.58>", > =C2=A0 =C2=A0"type": "Database Compaction", > =C2=A0 =C2=A0"task": "incoming retry", > =C2=A0 =C2=A0"status": "Copied 106794 of 159518 changes (66%)" > =C2=A0} > ] > > At first the task was just "incoming", but when it got to 100%, it starte= d > over again with the task now being "incoming retry." =C2=A0It's gotten to= the end > a few times now, each time starting over as a "retry" task. =C2=A0What ca= uses > that? > When compacting, Couch traverses a snapshot of the database and copies the current revisions out to a new, compacted database file. When it reaches the end, it needs to incorporate any new revisions that happened during the first pass. Each successive retry should be much faster than the last. In theory, if the database is busy enough, compaction might never finish. In practice, I don't think anyone has ever seen this occur. R