This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push:
new 9185e1ffd Ensure we always map the documents in order map mrview
updater
9185e1ffd is described below
commit 9185e1ffd5cb068fae8fef6736da8aff474c8d0f
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Mon Jan 27 16:56:44 2025 -0500
Ensure we always map the documents in order map mrview updater
Previously, we reversed Acc in `process_doc/3` but not in
`finish_update/1`. So
were processing elements out of order. For example: 1,2,...,22,32,31,...,23.
The view still build correctly but let's make it tidier and more consistent.
---
src/couch_mrview/src/couch_mrview_updater.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/couch_mrview/src/couch_mrview_updater.erl
b/src/couch_mrview/src/couch_mrview_updater.erl
index 969a82028..92e66d0fa 100644
--- a/src/couch_mrview/src/couch_mrview_updater.erl
+++ b/src/couch_mrview/src/couch_mrview_updater.erl
@@ -132,7 +132,7 @@ process_doc(#doc{id = Id} = Doc, Seq, #mrst{doc_acc = Acc}
= State) ->
finish_update(#mrst{doc_acc = Acc} = State) ->
if
Acc /= [] ->
- couch_work_queue:queue(State#mrst.doc_queue, Acc);
+ couch_work_queue:queue(State#mrst.doc_queue, lists:reverse(Acc));
true ->
ok
end,