You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Mike Wallace (JIRA)" <ji...@apache.org> on 2015/09/17 17:51:04 UTC

[jira] [Commented] (COUCHDB-2817) Compaction daemon will only compact views for shards that contain the design doc

    [ https://issues.apache.org/jira/browse/COUCHDB-2817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14803115#comment-14803115 ] 

Mike Wallace commented on COUCHDB-2817:
---------------------------------------

I hoped there'd be a simple fix here using mem3:dname/1 to get the cluster-level DB name and fabric:design_docs/1 to get the design docs, but this then fails for things like the _nodes and _dbs DBs which do not exist at the cluster level.

> Compaction daemon will only compact views for shards that contain the design doc
> --------------------------------------------------------------------------------
>
>                 Key: COUCHDB-2817
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2817
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Database Core
>            Reporter: Mike Wallace
>
> The compaction daemon is currently using couch_db:enum_docs/4 [1] to get the design documents for a database. This is a problem because couch_db:enum_docs/4 operates on a shard - we will therefore only get a list of all the design documents on that shard, rather than all design documents for the DB.
> This means view shards for the DB shard will not get compacted unless the design doc happens to be on that shard.
> I tested this out by generating some fragmented views and running the compaction daemon. After completion I found that only one view shard had been compacted [2] and verified that it was the shard that contains the design doc [3].
> [1] https://github.com/apache/couchdb-couch/blob/master/src/couch_compaction_daemon.erl#L235
> [2] https://gist.github.com/mikewallace1979/abf87e1ece983fad85b3#file-view_shard_sizes-sh-L5
> [3] https://gist.github.com/mikewallace1979/abf87e1ece983fad85b3#file-ddoc-sh-L1-L2



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)