You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2018/03/26 20:55:47 UTC

[couchdb] 16/33: WIP - couch_db_updater.erl

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch COUCHDB-3326-clustered-purge-davisp-refactor
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit b72bc0c01df5bab8d4071fc0d3ec0f65a16ce8bf
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Mon Mar 26 13:06:09 2018 -0500

    WIP - couch_db_updater.erl
---
 src/couch/src/couch_db_updater.erl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl
index 7ba3ce8..af935c7 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -661,7 +661,7 @@ purge_docs([Req | RestReqs], [FDI | RestInfos], USeq, PSeq, Acc) ->
             case couch_key_tree:remove_leafs(Tree, Revs) of
                 {_, []} ->
                     % No change
-                    {{not_found, not_found}, [], USeq};
+                    {no_change, [], USeq};
                 {[], Removed} ->
                     % Completely purged
                     {{FDI, not_found}, Removed, USeq};
@@ -686,11 +686,16 @@ purge_docs([Req | RestReqs], [FDI | RestInfos], USeq, PSeq, Acc) ->
                     {{FDI, NewFDI}, Removed, NewUpdateSeq}
             end;
         not_found ->
-            {{not_found, not_found}, [], USeq}
+            % Not found means nothing to change
+            {no_change, [], USeq}
     end,
     {Pairs, PInfos, Replies} = Acc,
+    NewPairs = case Pair of
+        no_change -> Pairs;
+        _ -> [Pair | Pairs]
+    end,
     NewAcc = {
-        [Pair | Pairs],
+        NewPairs,
         [{PSeq + 1, UUID, DocId, Revs} | PInfos],
         [{ok, RemovedRevs} | Replies]
     },

-- 
To stop receiving notification emails like this one, please contact
davisp@apache.org.