This is an automated email from the ASF dual-hosted git repository.
ming pushed a commit to branch pd-store
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git
The following commit(s) were added to refs/heads/pd-store by this push:
new c13b4e2b3 fix: check leader role before setPdConfig (#2341)
c13b4e2b3 is described below
commit c13b4e2b3ade9bc47675637365a9d11811b7fd3f
Author: V_Galaxy <[email protected]>
AuthorDate: Fri Nov 3 17:09:45 2023 +0800
fix: check leader role before setPdConfig (#2341)
---
.../src/main/java/org/apache/hugegraph/pd/ConfigService.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/ConfigService.java
b/hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/ConfigService.java
index 197e15510..289c39b0a 100644
---
a/hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/ConfigService.java
+++
b/hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/ConfigService.java
@@ -24,6 +24,7 @@ import org.apache.hugegraph.pd.config.PDConfig;
import org.apache.hugegraph.pd.grpc.Metapb;
import org.apache.hugegraph.pd.meta.ConfigMetaStore;
import org.apache.hugegraph.pd.meta.MetadataFactory;
+import org.apache.hugegraph.pd.raft.RaftEngine;
import org.apache.hugegraph.pd.raft.RaftStateListener;
import lombok.extern.slf4j.Slf4j;
@@ -87,6 +88,8 @@ public class ConfigService implements RaftStateListener {
.setMaxShardsPerStore(
pdConfig.getPartition().getMaxShardsPerStore())
.build();
+ }
+ if (RaftEngine.getInstance().isLeader()) {
this.meta.setPdConfig(mConfig);
}
pdConfig = updatePDConfig(mConfig);