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

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c3e6a841c1 [feature-wip](unique-key-merge-on-write) fix that sort 
segments by segment id in descending order (#11811)
c3e6a841c1 is described below

commit c3e6a841c15ea25d67319bba9226e4018f07ba5c
Author: Xin Liao <liaoxin...@126.com>
AuthorDate: Wed Aug 17 10:54:30 2022 +0800

    [feature-wip](unique-key-merge-on-write) fix that sort segments by segment 
id in descending order (#11811)
---
 be/src/olap/tablet.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index b7029278b6..9be70259a2 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -1887,6 +1887,9 @@ Status Tablet::lookup_row_key(const Slice& encoded_key, 
const RowsetIdUnorderedS
     // to search the key in the rowset with larger version.
     std::sort(selected_rs.begin(), selected_rs.end(),
               [](std::pair<RowsetSharedPtr, int32_t>& a, 
std::pair<RowsetSharedPtr, int32_t>& b) {
+                  if (a.first->end_version() == b.first->end_version()) {
+                      return a.second > b.second;
+                  }
                   return a.first->end_version() > b.first->end_version();
               });
     RowLocation loc;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to