[
https://issues.apache.org/jira/browse/COUCHDB-2817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175820#comment-15175820
]
Mike Wallace commented on COUCHDB-2817:
---------------------------------------
Noting there is a similar problem when attempting to compact view shards
manually:
http://stackoverflow.com/questions/35730682/couchdb-2-0-view-compaction
> 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
> 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)