You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/09/23 23:11:39 UTC

[GitHub] [couchdb] nickva opened a new pull request #3763: Make view merge row aggregation in fabric stable

nickva opened a new pull request #3763:
URL: https://github.com/apache/couchdb/pull/3763


   We do that by matching the comparator function behavior used during row [merging](https://github.com/apache/couchdb/blob/3.x/src/fabric/src/fabric_view_map.erl#L244-L248) in with the comparison function used when sorting the rows on view [shards](https://github.com/apache/couchdb/blob/3.x/src/couch_mrview/src/couch_mrview_util.erl#L1103-L1107). This goes along with the constraint in the `lists:merge/3` docs which indicates that the input lists should be sorted according to the same [comparator](https://erlang.org/doc/man/lists.html#merge-3) as the one passed to the `lists:merge/3` call.
   
   The stability of returned rows results from the case when both keys match as equal. Now `lists:merge/3` will favor the element in the existing rows list instead of always [replacing](https://github.com/erlang/otp/blob/master/lib/stdlib/src/lists.erl#L2668-L2675) the older matching row with the last arriving row, since now `less(A, A)` will be `false`, while previously it was `true`.
   
   The fix was found by Adam when discussing issue [3750](https://github.com/apache/couchdb/issues/3750#issuecomment-920947424)
   
   Co-author: Adam Kocoloski <ko...@apache.org>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva edited a comment on pull request #3763: Make view merge row aggregation in fabric stable

Posted by GitBox <gi...@apache.org>.
nickva edited a comment on pull request #3763:
URL: https://github.com/apache/couchdb/pull/3763#issuecomment-926885384


   > LGTM. Appreciate the co-author credit 🙏 but my email is [kocolosk@apache.org](mailto:kocolosk@apache.org)
   
   Oh, sorry! I corrected it both the commit message and the PR comment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] kocolosk commented on pull request #3763: Make view merge row aggregation in fabric stable

Posted by GitBox <gi...@apache.org>.
kocolosk commented on pull request #3763:
URL: https://github.com/apache/couchdb/pull/3763#issuecomment-926860933


   LGTM. Appreciate the co-author credit 🙏  but my email is kocolosk@apache.org


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva commented on pull request #3763: Make view merge row aggregation in fabric stable

Posted by GitBox <gi...@apache.org>.
nickva commented on pull request #3763:
URL: https://github.com/apache/couchdb/pull/3763#issuecomment-926228380


   The test script from issue 3750 can be used to verify the new behavior https://github.com/apache/couchdb/issues/3750#issuecomment-920978333


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva merged pull request #3763: Make view merge row aggregation in fabric stable

Posted by GitBox <gi...@apache.org>.
nickva merged pull request #3763:
URL: https://github.com/apache/couchdb/pull/3763


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva commented on pull request #3763: Make view merge row aggregation in fabric stable

Posted by GitBox <gi...@apache.org>.
nickva commented on pull request #3763:
URL: https://github.com/apache/couchdb/pull/3763#issuecomment-926885384


   > LGTM. Appreciate the co-author credit 🙏 but my email is [kocolosk@apache.org](mailto:kocolosk@apache.org)
   
   Oh, sorry! I corrected in both the commit message and the PR comment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org