xy720 opened a new pull request, #57051:
URL: https://github.com/apache/doris/pull/57051

   ### What problem does this PR solve?
   
   Related PR: #56168
   
   Problem Summary:
   
   show restore command throw npe after FE restart.
   
   
   ```
   mysql> show restore;
   ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke 
"org.apache.doris.backup.RestoreJob$RestoreJobState.name()" because 
"this.showState" is null
   ```
   
   FE LOG
   
   ```
   2025-10-16 15:27:08,504 WARN (mysql-nio-pool-2|303) 
[StmtExecutor.execute():542] Analyze failed. stmt[10, 
926978becf0a4056-a522dc89ae94f769]
   org.apache.doris.common.NereidsException: errCode = 2, detailMessage = 
Cannot invoke "org.apache.doris.backup.RestoreJob$RestoreJobState.name()" be
   cause "this.showState" is null
           at 
org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:700) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:537) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.StmtExecutor.queryRetry(StmtExecutor.java:499) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:484) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:309) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:196) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:231)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:259)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:403)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 
~[?:?]
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 
~[?:?]
           at java.lang.Thread.run(Thread.java:840) ~[?:?]
   Caused by: org.apache.doris.common.AnalysisException: errCode = 2, 
detailMessage = Cannot invoke "org.apache.doris.backup.RestoreJob$RestoreJobStat
   e.name()" because "this.showState" is null
           ... 13 more
   Caused by: java.lang.NullPointerException: Cannot invoke 
"org.apache.doris.backup.RestoreJob$RestoreJobState.name()" because 
"this.showState" is nu
   ll
           at org.apache.doris.backup.RestoreJob.getInfo(RestoreJob.java:2323) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.backup.RestoreJob.getFullInfo(RestoreJob.java:2309) 
~[doris-fe.jar:1.2-SNAPSHOT]
           at 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
           at 
java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) 
~[?:?]
           at 
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
           at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) 
~[?:?]
           at 
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) 
~[?:?]
           at 
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
           at 
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
           at 
org.apache.doris.nereids.trees.plans.commands.ShowRestoreCommand.handleShowRestore(ShowRestoreCommand.java:198)
 ~[doris-fe.jar:1.2-SNAPS
   HOT]
           at 
org.apache.doris.nereids.trees.plans.commands.ShowRestoreCommand.doRun(ShowRestoreCommand.java:206)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.nereids.trees.plans.commands.ShowCommand.run(ShowCommand.java:54)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:674) 
~[doris-fe.jar:1.2-SNAPSHOT]
           ... 12 more
   ```
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [x] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [x] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
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