kylinmac opened a new issue, #21879:
URL: https://github.com/apache/doris/issues/21879

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   1.1.5-rc02
   
   ### What's Wrong?
   
   NullPointerException when drop partition
   ```
   2023-07-17 15:35:47,506 WARN (thrift-server-pool-167906|1149486) 
[StmtExecutor.handleDdlStmt():1569] DDL statement(
   ALTER TABLE dwd_***  DROP PARTITION p**** ;) process failed.
   java.lang.NullPointerException: null
           at 
org.apache.doris.transaction.GlobalTransactionMgr.existCommittedTxns(GlobalTransactionMgr.java:328)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.catalog.Catalog.dropPartition(Catalog.java:3476) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.alter.Alter.processAlterOlapTable(Alter.java:169) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.alter.Alter.processAlterTable(Alter.java:385) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.catalog.Catalog.alterTable(Catalog.java:5355) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.qe.DdlExecutor.execute(DdlExecutor.java:142) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.qe.StmtExecutor.handleDdlStmt(StmtExecutor.java:1559) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:454) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.proxyExecute(ConnectProcessor.java:490) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.service.FrontendServiceImpl.forward(FrontendServiceImpl.java:675)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.thrift.FrontendService$Processor$forward.getResult(FrontendService.java:2096)
 ~[spark-dpp-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.thrift.FrontendService$Processor$forward.getResult(FrontendService.java:2076)
 ~[spark-dpp-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
           at 
org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38) 
~[spark-dpp-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
           at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:38) 
~[spark-dpp-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
           at 
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:313)
 ~[spark-dpp-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:1.8.0_341]
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:1.8.0_341]
           at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_341]
   ```
   txn become visible after  check for 
transactionState.getTableIdList().contains(tableId) ?
   ```
     public boolean existCommittedTxns(Long dbId, Long tableId, Long 
partitionId) {
           DatabaseTransactionMgr dbTransactionMgr = 
dbIdToDatabaseTransactionMgrs.get(dbId);
           if (tableId == null && partitionId == null) {
               return !dbTransactionMgr.getCommittedTxnList().isEmpty();
           }
   
           for (TransactionState transactionState : 
dbTransactionMgr.getCommittedTxnList()) {
               if (transactionState.getTableIdList().contains(tableId)) {
                   if (partitionId == null) {
                       return true;
                   } else if 
(transactionState.getTableCommitInfo(tableId).getPartitionCommitInfo(partitionId)
 != null) {
                       return true;
                   }
               }
           }
           return false;
       }
   ```
   
   ### What You Expected?
   
   return correct error message or wait for txn visible
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to