Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 97479 invoked from network); 1 Dec 2009 16:31:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Dec 2009 16:31:31 -0000 Received: (qmail 7393 invoked by uid 500); 1 Dec 2009 16:31:29 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 7344 invoked by uid 500); 1 Dec 2009 16:31:29 -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 7334 invoked by uid 99); 1 Dec 2009 16:31:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 16:31:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 209.85.222.182 as permitted sender) Received: from [209.85.222.182] (HELO mail-pz0-f182.google.com) (209.85.222.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 16:31:18 +0000 Received: by pzk12 with SMTP id 12so3480325pzk.13 for ; Tue, 01 Dec 2009 08:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=+Cl7aF8GKSpTDvpVpl1dOcqyBGrA+agE9DOvyQbkLMQ=; b=ryvjPqt1YT/dWvUFpj42lLEZC9yf6fE50yzpu1P3fxTfz4w7H0tmQ3w4WNPNwtNX/4 q6pfcIwt0xSFNjC7lS97JRa8W6TFmondnCvvgZl8xa01aXWo57730Y5YqqUQ7eV8qFqd tUlnkYyGXBaykYD8CQcL0pPnEgScJKX/Ohh38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=tjgTmPqvIX1FJWRbDsyFqe4Rk08ckAiqmnNQk3KY/hTF8kK3nOtR+TDol/lxenRemN 3G9+1uvxOWl8/nObAcPWJ9HFCsCHVkIlO4qiNeZuN6ZeDN+PF/B3kjznjVVhofes/mFH tw7XZhe6+6qOveQ2lb4L9uxEklXSvCwSXEoYg= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.143.21.30 with SMTP id y30mr637173wfi.229.1259685057570; Tue, 01 Dec 2009 08:30:57 -0800 (PST) In-Reply-To: References: Date: Tue, 1 Dec 2009 08:30:57 -0800 X-Google-Sender-Auth: 667cb583b0cc7ada Message-ID: Subject: Re: CouchDB Hangs on View Creation From: Chris Anderson 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, Dec 1, 2009 at 6:26 AM, Luke Sneeringer wrote: >> > Onto my issue. I have a database with about 59,000 documents. Some con= tain attachments, >> some do not. I tried to replicate (pull, not push) said database from on= e CouchDB instance >> to another one. The replication failed several times inexplicably, both = using curl on the >> command line (Ubuntu 9.10) and Futon. Finally, it succeeded in Futon. I = am defining "failed" >> here as that replication seemed to hang; the number of documents in the = target database did >> not increase, was less than the number of documents in the source databa= se (by many thousands), >> and the item disappeared from the status page in Futon. Also, on the fai= led attempts, replication >> failed in different places each time. >> > >> >> What is your couchdb version on both ends of the replication? > I'm using 0.10.0 on both sides. > >> >> Also, pay attention to database file size on the target. Sometimes >> with big attachments the doc count is unchanged as binary data is >> written for a long time. > I actually started watching the binary file size on view creation, and it= would stop increasing as well. I did not, however, monitor it on the repli= cation itself. >> >> > So eventually it succeeded. Huzzah. Except now I can't create any view= s. It just doesn't >> work. I never see my results. So, I went and started looking at the file= being created in >> /var/lib/couchdb/0.10.0/.dbname_design/. There's a .view file that gets = created, and its size >> goes up for awhile and then stops going up. At the time that file size c= eases to increase, >> I get a erl_crash.dump file that is 0 bytes in length. Not really valuab= le. >> > >> > The view scripts themselves are "known good"; they work on the source = server. >> >> Maybe a difference in versions. Can you supply a link to the view script= s? > I'm using 0.10.0 in both cases. > I attempted a couple of different views, but this was the first one and t= he one I was repeatedly working on: > function(doc) { > =A0 =A0for (var i in doc.groups) { > =A0 =A0 =A0 =A0if (i =3D=3D=3D 'author') { > =A0 =A0 =A0 =A0 =A0 =A0for (var j in doc.groups[i]) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0emit([doc.groups[i][j], doc.timestamp], do= c) > =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0} > =A0 =A0} > } Do you have some gigantic docs, or are most of them less than 4kB? Also, this looks like an equivalent function to me (but shouldn't make a difference unless you have very large docs): function(doc) { if (doc.groups && doc.groups.author) { doc.groups.author.forEach(function(a) { emit([a, doc.timestamp], null) }); } } the main difference here being one less nested loop. The other difference is that I'm emitting null instead of doc as the value. This would be a good diagnostic to see how much faster it with smaller values. Also, you are sure you don't have any reduces elsewhere in the design document? All views in a ddoc are indexed together, so if you have a different view working with this one, it could be the culprit. > And thank you, by the way! > > Best Regards, > Luke Sneeringer --=20 Chris Anderson http://jchrisa.net http://couch.io