JAkutenshi commented on code in PR #7813:
URL: https://github.com/apache/ignite-3/pull/7813#discussion_r3043430289
##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -784,6 +785,12 @@ public class IgniteImpl implements Ignite {
raftGroupEventsClientListener
);
+ var msRaftServiceFactory = new
PhysicalTopologyAwareRaftGroupServiceFactory(
Review Comment:
Resolved
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/client/PhysicalTopologyAwareRaftGroupService.java:
##########
@@ -327,6 +327,13 @@ public void unsubscribeLeader(LeaderElectionListener
callback) {
@Override
public <R> CompletableFuture<R> run(Command cmd, long timeoutMillis) {
+ if (commandExecutor.leader() == null && timeoutMillis != 0) {
+ // Discover the leader first, similar to
RaftGroupServiceImpl.run() behavior.
+ // Without this, the command is sent to a random peer causing
cascading EPERM errors
+ // and potential hangs due to race conditions with leader election
notifications.
+ return refreshAndGetLeaderWithTerm(timeoutMillis)
+ .thenCompose(ignored -> commandExecutor.run(cmd,
timeoutMillis));
+ }
Review Comment:
Resolved.
--
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]