Merge pull request #2986 from alibaba/hotfix_job_execute_condition
[#2985] fix task executable judgment logic problems
This commit is contained in:
commit
99539dd330
@ -160,6 +160,9 @@ public class EmbeddedDumpService extends DumpService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canExecute() {
|
protected boolean canExecute() {
|
||||||
|
if (ApplicationUtils.getStandaloneMode()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// if is derby + raft mode, only leader can execute
|
// if is derby + raft mode, only leader can execute
|
||||||
CPProtocol protocol = protocolManager.getCpProtocol();
|
CPProtocol protocol = protocolManager.getCpProtocol();
|
||||||
return protocol.isLeader(Constants.CONFIG_MODEL_RAFT_GROUP);
|
return protocol.isLeader(Constants.CONFIG_MODEL_RAFT_GROUP);
|
||||||
|
@ -109,15 +109,11 @@ public class MergeDatumService {
|
|||||||
if (!PropertyUtil.isEmbeddedStorage()) {
|
if (!PropertyUtil.isEmbeddedStorage()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
try {
|
if (ApplicationUtils.getStandaloneMode()) {
|
||||||
ProtocolManager protocolManager = ApplicationUtils.getBean(ProtocolManager.class);
|
|
||||||
return protocolManager.getCpProtocol().isLeader(Constants.CONFIG_MODEL_RAFT_GROUP);
|
|
||||||
} catch (NoSuchRaftGroupException e) {
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
|
||||||
// It's impossible to get to this point
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
|
ProtocolManager protocolManager = ApplicationUtils.getBean(ProtocolManager.class);
|
||||||
|
return protocolManager.getCpProtocol().isLeader(Constants.CONFIG_MODEL_RAFT_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
class MergeAllDataWorker extends Thread {
|
class MergeAllDataWorker extends Thread {
|
||||||
|
Loading…
Reference in New Issue
Block a user