You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by robertkowalski <gi...@git.apache.org> on 2015/08/21 14:17:21 UTC

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

GitHub user robertkowalski opened a pull request:

    https://github.com/apache/couchdb-fabric/pull/27

    add clusterwide compaction for dbs

    COUCHDB-2492

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robertkowalski/couchdb-fabric 2492-compaction

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fabric/pull/27.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #27
    
----
commit 05e7ce2abf4ceabd92df5c7a24beabe5df4a8204
Author: Robert Kowalski <ro...@apache.org>
Date:   2015-08-21T12:16:34Z

    add clusterwide compaction for dbs
    
    COUCHDB-2492

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by eiri <gi...@git.apache.org>.
Github user eiri commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/27#discussion_r37630165
  
    --- Diff: src/fabric_rpc.erl ---
    @@ -132,6 +133,11 @@ delete_db(DbName) ->
     delete_shard_db_doc(_, DocId) ->
         rexi:reply(mem3_util:delete_db_doc(DocId)).
     
    +compact_db(DbName) ->
    +    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
    +    {ok, _} = couch_db:start_compact(Db),
    +    couch_db:close(Db).
    --- End diff --
    
    You don't need to close, it'll happen automatically on the compaction completion.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-fabric/pull/27#issuecomment-138864555
  
    Ah, you know, I think this is the wrong direction. Cluster-wide compaction has a serious performance impact. Like with BigCouch, couchdb administrators should manage this on the backend interface.
    
    -1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/27#discussion_r37633244
  
    --- Diff: src/fabric.erl ---
    @@ -33,7 +33,7 @@
     
     % miscellany
     -export([design_docs/1, reset_validation_funs/1, cleanup_index_files/0,
    -    cleanup_index_files/1, dbname/1]).
    +    cleanup_index_files/1, dbname/1, compact_db_all_nodes/1]).
    --- End diff --
    
    call this `compact_db`, the reason for fabric and fabric rpc is to do clustered database operations.
    
    Separately, we'll need a way to disable this at Cloudant.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/27#discussion_r37764740
  
    --- Diff: src/fabric_rpc.erl ---
    @@ -132,6 +133,17 @@ delete_db(DbName) ->
     delete_shard_db_doc(_, DocId) ->
         rexi:reply(mem3_util:delete_db_doc(DocId)).
     
    +compact_db(DbName) ->
    +    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
    +    try
    +        {ok, _} = couch_db:start_compact(Db)
    +    after
    +        couch_db:close(Db)
    +    end.
    +
    +compact_view(DbName, DesignId) ->
    +    ok = couch_mrview:compact(DbName, DesignId).
    --- End diff --
    
    have you confirmed this works when the design document is not present in the shard?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-fabric/pull/27#issuecomment-134621027
  
    +1 after squash.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski closed the pull request at:

    https://github.com/apache/couchdb-fabric/pull/27


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: add clusterwide compaction for dbs

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/27#discussion_r37632939
  
    --- Diff: src/fabric_rpc.erl ---
    @@ -132,6 +133,11 @@ delete_db(DbName) ->
     delete_shard_db_doc(_, DocId) ->
         rexi:reply(mem3_util:delete_db_doc(DocId)).
     
    +compact_db(DbName) ->
    +    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
    +    {ok, _} = couch_db:start_compact(Db),
    +    couch_db:close(Db).
    --- End diff --
    
    you do need to close, and please put a try/finally around that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---