You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2016/08/11 11:28:18 UTC

[1/2] chttpd commit: updated refs/heads/master to 663273b

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 68f8fa50d -> 663273b0e


make _view_cleanup endpoint cluster aware

Currently _view_cleanup endpoint is not cluster aware, only deletes
indexes on the node that gets the request. This will make it cluster
aware, deleting unused indexes on all nodes.

JIRA: COUCHDB-2779


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/f0f4c0dd
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/f0f4c0dd
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/f0f4c0dd

Branch: refs/heads/master
Commit: f0f4c0ddecb7b70e509a887900ec94a7f96c1eb9
Parents: 8aa7adf
Author: Mayya Sharipova <ma...@ca.ibm.com>
Authored: Wed Aug 19 12:15:23 2015 -0400
Committer: Mayya Sharipova <ma...@ca.ibm.com>
Committed: Wed Aug 19 12:15:23 2015 -0400

----------------------------------------------------------------------
 src/chttpd_db.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/f0f4c0dd/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index a8fdc16..f5a3176 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -230,7 +230,7 @@ handle_compact_req(Req, _) ->
     couch_httpd:send_error(Req, 403, forbidden, Msg).
 
 handle_view_cleanup_req(Req, Db) ->
-    ok = fabric:cleanup_index_files(Db),
+    ok = fabric:cleanup_index_files_all_nodes(Db),
     send_json(Req, 202, {[{ok, true}]}).
 
 handle_design_req(#httpd{


[2/2] chttpd commit: updated refs/heads/master to 663273b

Posted by rn...@apache.org.
Merge remote-tracking branch 'cloudant/2779-view-cleanup-cluster-aware'


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/663273b0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/663273b0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/663273b0

Branch: refs/heads/master
Commit: 663273b0ed2ea4eae16d9d36e1922138fb25e766
Parents: 68f8fa5 f0f4c0d
Author: Robert Newson <rn...@apache.org>
Authored: Thu Aug 11 12:28:05 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 11 12:28:05 2016 +0100

----------------------------------------------------------------------
 src/chttpd_db.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/663273b0/src/chttpd_db.erl
----------------------------------------------------------------------
diff --cc src/chttpd_db.erl
index 7f0dce7,f5a3176..fbf59ef
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@@ -225,27 -225,12 +225,27 @@@ maybe_flush_changes_feed(Acc0, Data, Le
      },
      {ok, Acc}.
  
 -handle_compact_req(Req, _) ->
 -    Msg = <<"Compaction must be triggered on a per-shard basis in CouchDB">>,
 -    couch_httpd:send_error(Req, 403, forbidden, Msg).
 +handle_compact_req(#httpd{method='POST'}=Req, Db) ->
 +    chttpd:validate_ctype(Req, "application/json"),
 +    case Req#httpd.path_parts of
 +        [_DbName, <<"_compact">>] ->
 +            ok = fabric:compact(Db),
 +            send_json(Req, 202, {[{ok, true}]});
 +        [DbName, <<"_compact">>, DesignName | _] ->
 +            case ddoc_cache:open(DbName, <<"_design/", DesignName/binary>>) of
 +                {ok, _DDoc} ->
 +                    ok = fabric:compact(Db, DesignName),
 +                    send_json(Req, 202, {[{ok, true}]});
 +                Error ->
 +                    throw(Error)
 +            end
 +    end;
 +
 +handle_compact_req(Req, _Db) ->
 +    send_method_not_allowed(Req, "POST").
  
  handle_view_cleanup_req(Req, Db) ->
-     ok = fabric:cleanup_index_files(Db),
+     ok = fabric:cleanup_index_files_all_nodes(Db),
      send_json(Req, 202, {[{ok, true}]}).
  
  handle_design_req(#httpd{