HHoflittlefish777 opened a new pull request, #31095:
URL: https://github.com/apache/doris/pull/31095
## Proposed changes
### question
When replay some
```
Operation Type 201
java.lang.NullPointerException: null at
org.apache.doris.load.routineload.RoutineLoadManager.replayChangeRoutineLoadJob(RoutineLoadManager.java:726)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.persist.EditLog.loadJournal(EditLog.java:669)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.catalog.Env.replayJournal(Env.java:2513)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.catalog.Env.transferToMaster(Env.java:1285)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.catalog.Env.access$1200(Env.java:282)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.catalog.Env$4.runOneCycle(Env.java:2429)
~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.common.util.Daemon.run(Daemon.java:116)
~[doris-fe.jar:1.2-SNAPSHOT]
```
### why this happened
it may cause the editLog out of order in the following scenarios:
thread A: create job and record job meta
thread B: change job state and persist in editlog according to meta
thread A: persist in editlog
which will cause null pointer exception when replaying editLog
### how to solve this problem
Use lock to make sure record meta in memory and write editlog is atomicity,
when pause or stop the job, these two states must be completed simultaneously
when the job is visible.
<!--Describe your changes.-->
## Further comments
If this is a relatively large or complex change, kick off the discussion at
[[email protected]](mailto:[email protected]) by explaining why you
chose the solution you did and what alternatives you considered, etc...
--
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]