This is an automated email from the ASF dual-hosted git repository. vatamane pushed a commit to branch map-doc-updates-in-order in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 7e4991e53af1c2b4b5bb1120b5303e85afc4c4cf 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,
