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 2021/09/15 21:25:50 UTC

[couchdb] branch fix-limit0-for-views-again created (now 4e158bb)

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

rnewson pushed a change to branch fix-limit0-for-views-again
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 4e158bb  Restrict the limit=0 clause to the sorted=false case as originally intended

This branch includes the following new commits:

     new 064db6f  Revert "Fix meta result for views when limit = 0"
     new 4e158bb  Restrict the limit=0 clause to the sorted=false case as originally intended

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[couchdb] 01/02: Revert "Fix meta result for views when limit = 0"

Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch fix-limit0-for-views-again
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 064db6ff21fab2baa8254b7eba90c0a2a79b0b88
Author: Robert Newson <rn...@apache.org>
AuthorDate: Wed Sep 15 22:22:14 2021 +0100

    Revert "Fix meta result for views when limit = 0"
    
    This reverts commit a36e7308ab4a2cfead6da64a9f83b7776722382d.
---
 src/fabric/src/fabric_view_map.erl | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/fabric/src/fabric_view_map.erl b/src/fabric/src/fabric_view_map.erl
index 6477654..b8d0d39 100644
--- a/src/fabric/src/fabric_view_map.erl
+++ b/src/fabric/src/fabric_view_map.erl
@@ -146,11 +146,10 @@ handle_message({meta, Meta0}, {Worker, From}, State) ->
         }}
     end;
 
-handle_message(#view_row{}, {_, From}, #collector{limit=0} = State) ->
-    rexi:stream_ack(From),
-    % Rely on limit=0 clause in maybe_send_row/1 to wait until all
-    % shard ranges reply with meta
-    fabric_view:maybe_send_row(State);
+handle_message(#view_row{}, {_, _}, #collector{limit=0} = State) ->
+    #collector{callback=Callback} = State,
+    {_, Acc} = Callback(complete, State#collector.user_acc),
+    {stop, State#collector{user_acc=Acc}};
 
 handle_message(#view_row{} = Row, {_,From}, #collector{sorted=false} = St) ->
     #collector{callback=Callback, user_acc=AccIn, limit=Limit} = St,

[couchdb] 02/02: Restrict the limit=0 clause to the sorted=false case as originally intended

Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch fix-limit0-for-views-again
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 4e158bbe136d02c81bad8e928fb9febe1777df17
Author: Robert Newson <rn...@apache.org>
AuthorDate: Wed Sep 15 22:22:43 2021 +0100

    Restrict the limit=0 clause to the sorted=false case as originally intended
    
    The limit=0 clause was introduced in commit 4e0c97bf which added
    sorted=false support. It accidentally matches when the user specifies
    limit=0 and causes us not to apply the logic that ensures we collect a
    {meta, Meta} message from each shard range and then send the
    total_rows and offset fields.
---
 src/fabric/src/fabric_view_map.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fabric/src/fabric_view_map.erl b/src/fabric/src/fabric_view_map.erl
index b8d0d39..ff6aa8b 100644
--- a/src/fabric/src/fabric_view_map.erl
+++ b/src/fabric/src/fabric_view_map.erl
@@ -146,7 +146,7 @@ handle_message({meta, Meta0}, {Worker, From}, State) ->
         }}
     end;
 
-handle_message(#view_row{}, {_, _}, #collector{limit=0} = State) ->
+handle_message(#view_row{}, {_, _}, #collector{sorted=false, limit=0} = State) ->
     #collector{callback=Callback} = State,
     {_, Acc} = Callback(complete, State#collector.user_acc),
     {stop, State#collector{user_acc=Acc}};