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

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


The following commit(s) were added to refs/heads/master by this push:
     new 73b89b5  [Bug][Cache] Version should not be considered when find the 
latest partition (#5408)
73b89b5 is described below

commit 73b89b58f331e46dcc1d81223d80a9f2b217b6bf
Author: Yingchun Lai <[email protected]>
AuthorDate: Wed Feb 24 11:23:19 2021 +0800

    [Bug][Cache] Version should not be considered when find the latest 
partition (#5408)
    
    When a table has multiple partitions, each partition has it's own
    version, the version doesn't represent whether it's newer or not. When a
    partition has a large version, it may be considered as the largest one
    currently, this will cause incorrect query result.
    Suppose there are 2 partitions:
    PartitionName | VisibleVersion |  VisibleVersionTime
    p1            |            123 | 2021-02-17 23:31:32
    p2            |             23 | 2021-02-22 11:39:19
    Partition p1 will be considered as the lastest partition, and there is a
    cache before p2's last update time, the cache will hit and return an
    error result.
---
 fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java
index 32e2878..ddd2725 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java
@@ -416,8 +416,7 @@ public class CacheAnalyzer {
         CacheTable table = new CacheTable();
         table.olapTable = olapTable;
         for (Partition partition : olapTable.getPartitions()) {
-            if (partition.getVisibleVersionTime() >= table.latestTime &&
-                    partition.getVisibleVersion() > table.latestVersion) {
+            if (partition.getVisibleVersionTime() >= table.latestTime) {
                 table.latestPartitionId = partition.getId();
                 table.latestTime = partition.getVisibleVersionTime();
                 table.latestVersion = partition.getVisibleVersion();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to