Skip to content

[Bug][Cache] Get cache returns unknow error #5726

@xinghuayu007

Description

@xinghuayu007

Describe the bug
When a query executed with cache enabled, it returns error:
2021-04-26 16:18:25,898 WARN (doris-mysql-nio-pool-3|156) [StmtExecutor.execute():337] execute Exception
java.lang.NullPointerException: null at org.apache.doris.qe.cache.CacheProxy$FetchCacheResult.setResult(CacheProxy.java:229) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheBeProxy.fetchCache(CacheBeProxy.java:97) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.SqlCache.getCacheData(SqlCache.java:44) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheAnalyzer.getCacheData(CacheAnalyzer.java:280) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleCacheStmt(StmtExecutor.java:646) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleQueryStmt(StmtExecutor.java:737) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:273) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:192) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:324) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:509) ~[palo-fe.jar:3.4.0] at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?]

To Reproduce
Steps to reproduce the behavior:

  1. create a table with 3 more partitions, set enable_sql_cache=true:
    2021-04-28 16-44-37屏幕截图

  2. insert some data into partition p201707, this partition becomes the lastest partition
    2021-04-28 16-45-00屏幕截图

  3. query twice this table, the cache has been planted.
    2021-04-28 16-45-38屏幕截图

  4. insert some data into partition p201709, this partition becomes the lastest partition
    2021-04-28 16-45-58屏幕截图

  5. query twice this table, the cache has been planted.
    2021-04-28 16-46-11屏幕截图

  6. insert some data into partition p201708, this partition becomes the lastest partition
    2021-04-28 16-46-25屏幕截图

  7. quey this table, return error
    2021-04-28 16-46-38屏幕截图

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions