ExploreHeart opened a new issue, #2449:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2449

   When the leader node is faulty, the flag for re-sharding cannot be set.
   After the leader node is reselected, the re-sharding flag is not set. As a 
result, the faulty shard cannot be executed.
   @TeslaCN
   https://github.com/apache/shardingsphere-elasticjob/pull/1472
   
   ### Solution:
   
   ```
   class LeaderElectionJobListener implements DataChangedEventListener {
           
           @Override
           public void onChange(final DataChangedEvent event) {
               if (!JobRegistry.getInstance().isShutdown(jobName) && 
(isActiveElection(event.getKey(), event.getValue()) || 
isPassiveElection(event.getKey(), event.getType()))) {
                   leaderService.electLeader();
                  // Trigger failover and set shard identifiers.
                   shardingService.setReshardingFlag();
                   failoverService.failoverIfNecessary();
               }
           }
   }
   ```


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

Reply via email to