liaoxin01 commented on code in PR #31095:
URL: https://github.com/apache/doris/pull/31095#discussion_r1494093313
##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadManager.java:
##########
@@ -307,12 +307,23 @@ public List<RoutineLoadJob> checkPrivAndGetAllJobs(String
dbName)
public void pauseRoutineLoadJob(PauseRoutineLoadStmt pauseRoutineLoadStmt)
throws UserException {
List<RoutineLoadJob> jobs = Lists.newArrayList();
- if (pauseRoutineLoadStmt.isAll()) {
- jobs =
checkPrivAndGetAllJobs(pauseRoutineLoadStmt.getDbFullName());
- } else {
- RoutineLoadJob routineLoadJob =
checkPrivAndGetJob(pauseRoutineLoadStmt.getDbFullName(),
- pauseRoutineLoadStmt.getName());
- jobs.add(routineLoadJob);
+ // it needs lock when getting routine load job,
+ // otherwise, 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 the null pointer exception when replaying editLog
+ writeLock();
Review Comment:
Just use the readlock.
--
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]