This is an automated email from the ASF dual-hosted git repository.

jianbin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 205581771b bugfix: The time difference between the raft node and the 
follower node cannot synchronize data. (#7150)
205581771b is described below

commit 205581771b46a1f5b72b47b008bc4f0663018141
Author: PeppaO <39424591+pep...@users.noreply.github.com>
AuthorDate: Mon Feb 10 16:51:26 2025 +0800

    bugfix: The time difference between the raft node and the follower node 
cannot synchronize data. (#7150)
---
 changes/en-us/2.x.md                                                | 1 +
 changes/zh-cn/2.x.md                                                | 1 +
 .../java/org/apache/seata/server/cluster/raft/RaftStateMachine.java | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index bf2109751b..ec5028808d 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -18,6 +18,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7107](https://github.com/apache/incubator-seata/pull/7107)] fix the issue 
of failing to parse annotations in TCC mode when the business object is a proxy 
object.
 - [[#7124](https://github.com/apache/incubator-seata/pull/7124)] bugfix: 
GlobalTransactionScanner.afterPropertiesSet need do scanner check
 - [[#7135](https://github.com/apache/incubator-seata/pull/7135)] treating a 
unique index conflict during rollback as a dirty write
+- [[#7150](https://github.com/apache/incubator-seata/pull/7150)] The time 
difference between the raft node and the follower node cannot synchronize data
 
 ### optimize:
 
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index cfea041994..fcd62bc04a 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -18,6 +18,7 @@
 - [[#7107](https://github.com/apache/incubator-seata/pull/7107)] 
修复tcc模式下,当业务对象为代理对象时,解析注解失败问题。
 - [[#7124](https://github.com/apache/incubator-seata/pull/7124)] 
GlobalTransactionScanner.afterPropertiesSet方法需要做扫描检查
 - [[#7135](https://github.com/apache/incubator-seata/pull/7135)] 
回滚时遇到唯一索引冲突视为脏写
+- [[#7150](https://github.com/apache/incubator-seata/pull/7150)] 
raft节点之前时间差,follower节点无法同步数据
 
 ### optimize:
 
diff --git 
a/server/src/main/java/org/apache/seata/server/cluster/raft/RaftStateMachine.java
 
b/server/src/main/java/org/apache/seata/server/cluster/raft/RaftStateMachine.java
index 2b14b2a5cb..6ba9d66673 100644
--- 
a/server/src/main/java/org/apache/seata/server/cluster/raft/RaftStateMachine.java
+++ 
b/server/src/main/java/org/apache/seata/server/cluster/raft/RaftStateMachine.java
@@ -390,8 +390,11 @@ public class RaftStateMachine extends StateMachineAdapter {
                 PeerId peerId = RouteTable.getInstance().selectLeader(group);
                 if (peerId != null) {
                     syncCurrentNodeInfo(peerId);
+                } else {
+                    initSync.compareAndSet(true, false);
                 }
             } catch (Exception e) {
+                initSync.compareAndSet(true, false);
                 LOGGER.error(e.getMessage(), e);
             }
         }
@@ -439,8 +442,11 @@ public class RaftStateMachine extends StateMachineAdapter {
                                 err);
                         }
                     }, 30000);
+            } else {
+                initSync.compareAndSet(true, false);
             }
         } catch (Exception e) {
+            initSync.compareAndSet(true, false);
             LOGGER.error(e.getMessage(), e);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to