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 8478D1F26 for ; Wed, 20 Apr 2011 23:47:46 +0000 (UTC) Received: (qmail 816 invoked by uid 500); 20 Apr 2011 23:47:46 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 791 invoked by uid 500); 20 Apr 2011 23:47:46 -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 783 invoked by uid 99); 20 Apr 2011 23:47:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2011 23:47:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2011 23:47:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B2AF6AB49E for ; Wed, 20 Apr 2011 23:47:05 +0000 (UTC) Date: Wed, 20 Apr 2011 23:47:05 +0000 (UTC) From: "Filipe Manana (JIRA)" To: dev@couchdb.apache.org Message-ID: <392718541.72194.1303343225728.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1258249236.72160.1303342505694.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1134) Bug in database size calculation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-1134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022546#comment-13022546 ] Filipe Manana commented on COUCHDB-1134: ---------------------------------------- Good finding Paul. This missing clause should fix it: diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index ed72bb6..7952366 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -281,6 +281,8 @@ db_data_size(_, nil, _) -> db_data_size(_, _, {_Count, _DelCount}) -> % pre 1.2 format, upgraded on compaction null; +db_data_size(_, _, {_Count, _DelCount, nil}) -> + null; db_data_size(SeqBtreeSize, IdBtreeSize, {_Count, _DelCount, DocAndAttsSize}) -> SeqBtreeSize + IdBtreeSize + DocAndAttsSize. > Bug in database size calculation > -------------------------------- > > Key: COUCHDB-1134 > URL: https://issues.apache.org/jira/browse/COUCHDB-1134 > Project: CouchDB > Issue Type: Bug > Affects Versions: 1.2 > Reporter: Paul Joseph Davis > > Noticed these backtraces while poking at something else. Haven't even peeped the code so I've got no idea if its trivial. These are also old databases. > [error] [<0.120.0>] Uncaught error in HTTP request: {error,badarith} > [info] [<0.120.0>] Stacktrace: [{couch_db,db_data_size,3}, > {couch_db,get_db_info,1}, > {couch_httpd_db,db_req,2}, > {couch_httpd_db,do_db_req,2}, > {couch_httpd,handle_request_int,5}, > {mochiweb_http,headers,5}, > {proc_lib,init_p_do_apply,3}] > [info] [<0.120.0>] 127.0.0.1 - - GET /foo 500 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira