Skip to content

Commit

Permalink
fix(hstore): enable JRaft MaxBodySize config (#2633)
Browse files Browse the repository at this point in the history
* enable JRaft MaxBodySize config
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.hugegraph.store.node.AppConfig$Raft': Unsatisfied dependency expressed through field 'maxBodySize'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "512*1024"

---------

Co-authored-by: V_Galaxy <[email protected]>
  • Loading branch information
JackyYangPassion and VGalaxies authored Aug 18, 2024
1 parent ba5b89e commit 58f58ee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public LogStorage createLogStorage(final String uri, final RaftOptions raftOptio
raftOptions.setMaxReplicatorInflightMsgs(
options.getRaftOptions().getMaxReplicatorInflightMsgs());
raftOptions.setMaxByteCountPerRpc(1024 * 1024);
raftOptions.setMaxBodySize(options.getRaftOptions().getMaxBodySize());
nodeOptions.setEnableMetrics(true);

final PeerId serverId = JRaftUtils.getPeerId(options.getRaftAddress());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public static class RaftOptions {
* The maximum number of entries in AppendEntriesRequest
*/
private int maxEntriesSize = 256;
/**
* The maximum byte size of AppendEntriesRequest
*/
private int maxBodySize = 512 * 1024;
/**
* Raft cluster data backlog occurs, rate limiting wait time in milliseconds.
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,20 @@ public class Raft {
private int snapshotInterval;
@Value("${raft.disruptorBufferSize:0}")
private int disruptorBufferSize;
@Value("${raft.max-log-file-size: 50000000000}")
@Value("${raft.max-log-file-size:50000000000}")
private long maxLogFileSize;
@Value("${ave-logEntry-size-ratio : 0.95}")
@Value("${ave-logEntry-size-ratio:0.95}")
private double aveLogEntrySizeRation;
@Value("${raft.useRocksDBSegmentLogStorage: true}")
@Value("${raft.useRocksDBSegmentLogStorage:true}")
private boolean useRocksDBSegmentLogStorage;
@Value("${raft.maxSegmentFileSize:67108864}")
private int maxSegmentFileSize;
@Value("${raft.maxReplicatorInflightMsgs:256}")
private int maxReplicatorInflightMsgs;
@Value("${raft.maxEntriesSize:256}")
private int maxEntriesSize;
@Value("${raft.maxBodySize:524288}")
private int maxBodySize;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public void init() {
setMaxSegmentFileSize(appConfig.getRaft().getMaxSegmentFileSize());
setMaxReplicatorInflightMsgs(appConfig.getRaft().getMaxReplicatorInflightMsgs());
setMaxEntriesSize(appConfig.getRaft().getMaxEntriesSize());
setMaxBodySize(appConfig.getRaft().getMaxBodySize());
}});
setFakePdOptions(new FakePdOptions() {{
setStoreList(appConfig.getFakePdConfig().getStoreList());
Expand Down

0 comments on commit 58f58ee

Please sign in to comment.