summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjjrodrig <jjrodrig@gmail.com>2018-03-29 23:34:42 +0200
committerJan Lehnardt <jan@apache.org>2018-07-13 13:43:43 +0200
commit177c22d0f541fdeb6e0f6457ab6ea9afa7bdea9a (patch)
tree9d8e9ed6595e318ae8da160ed972095bc21c0065
parent80e431f11a401f78651dd4f8f34326b2e5109557 (diff)
downloadcouchdb-177c22d0f541fdeb6e0f6457ab6ea9afa7bdea9a.tar.gz
Deletion responds 200 after a response from every node, and 202 in other case
-rw-r--r--src/fabric/src/fabric_db_delete.erl4
-rw-r--r--test/javascript/tests-cluster/with-quorum/db-deletion.js6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/fabric/src/fabric_db_delete.erl b/src/fabric/src/fabric_db_delete.erl
index a1b51088b..c146cb6cd 100644
--- a/src/fabric/src/fabric_db_delete.erl
+++ b/src/fabric/src/fabric_db_delete.erl
@@ -79,9 +79,9 @@ maybe_stop(W, Counters) ->
case {Ok + NotFound, Ok, NotFound} of
{W, 0, W} ->
{#shard{dbname=Name}, _} = hd(Counters),
- couch_log:warning("~p not_found ~s", [?MODULE, Name]),
+ couch_log:warning("~p not_found ~d", [?MODULE, Name]),
{stop, not_found};
- {N, M, _} when N >= (W div 2 + 1), M > 0 ->
+ {W, _, _} ->
{stop, ok};
{_, M, _} when M > 0 ->
{stop,accepted};
diff --git a/test/javascript/tests-cluster/with-quorum/db-deletion.js b/test/javascript/tests-cluster/with-quorum/db-deletion.js
index f561e3a0c..079fb493d 100644
--- a/test/javascript/tests-cluster/with-quorum/db-deletion.js
+++ b/test/javascript/tests-cluster/with-quorum/db-deletion.js
@@ -19,10 +19,10 @@ couchTests.db_deletion = function(debug) {
var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
db.createDb();
-
- // DB Deletion should return 200 - Ok
+
+ // DB Deletion should return 202 - Acceted as the custer is not complete
xhr = CouchDB.request("DELETE", "/" + db_name + "/");
- T(xhr.status == 200);
+ T(xhr.status == 202);
// DB Deletion should return 404 - Not found
xhr = CouchDB.request("DELETE", "/not-existing-db/");