Skip to content

Commit

Permalink
fix: check leader role before setPdConfig (#2341)
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies authored Nov 3, 2023
1 parent 823b190 commit c13b4e2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down Expand Up @@ -87,6 +88,8 @@ public PDConfig loadConfig() {
.setMaxShardsPerStore(
pdConfig.getPartition().getMaxShardsPerStore())
.build();
}
if (RaftEngine.getInstance().isLeader()) {
this.meta.setPdConfig(mConfig);
}
pdConfig = updatePDConfig(mConfig);
Expand Down

0 comments on commit c13b4e2

Please sign in to comment.