Skip to content

Commit 9185e1f

Browse files
committed
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.
1 parent 3d3f4f2 commit 9185e1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/couch_mrview/src/couch_mrview_updater.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ process_doc(#doc{id = Id} = Doc, Seq, #mrst{doc_acc = Acc} = State) ->
132132
finish_update(#mrst{doc_acc = Acc} = State) ->
133133
if
134134
Acc /= [] ->
135-
couch_work_queue:queue(State#mrst.doc_queue, Acc);
135+
couch_work_queue:queue(State#mrst.doc_queue, lists:reverse(Acc));
136136
true ->
137137
ok
138138
end,

0 commit comments

Comments
 (0)