|
|
@ -202,8 +202,9 @@ public class MasterSchedulerService extends BaseDaemonThread { |
|
|
|
for (final Command command : commands) { |
|
|
|
for (final Command command : commands) { |
|
|
|
masterPrepareExecService.execute(() -> { |
|
|
|
masterPrepareExecService.execute(() -> { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// todo: this check is not safe, the slot may change after command transform.
|
|
|
|
// Note: this check is not safe, the slot may change after command transform.
|
|
|
|
// slot check again
|
|
|
|
// We use the database transaction in `handleCommand` so that we can guarantee the command will always be executed
|
|
|
|
|
|
|
|
// by only one master
|
|
|
|
SlotCheckState slotCheckState = slotCheck(command); |
|
|
|
SlotCheckState slotCheckState = slotCheck(command); |
|
|
|
if (slotCheckState.equals(SlotCheckState.CHANGE) || slotCheckState.equals(SlotCheckState.INJECT)) { |
|
|
|
if (slotCheckState.equals(SlotCheckState.CHANGE) || slotCheckState.equals(SlotCheckState.INJECT)) { |
|
|
|
logger.info("Master handle command {} skip, slot check state: {}", command.getId(), slotCheckState); |
|
|
|
logger.info("Master handle command {} skip, slot check state: {}", command.getId(), slotCheckState); |
|
|
|