HDDS-912. Update ozone to latest ratis snapshot build (0.4.0-3b0be02-SNAPSHOT). Contributed by Lokesh Jain.
This commit is contained in:
parent
4ff1c46d95
commit
b51e9e4317
|
@ -78,7 +78,7 @@ public final class ScmConfigKeys {
|
||||||
public static final String DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY =
|
public static final String DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY =
|
||||||
"dfs.container.ratis.segment.preallocated.size";
|
"dfs.container.ratis.segment.preallocated.size";
|
||||||
public static final String
|
public static final String
|
||||||
DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT = "128MB";
|
DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT = "16KB";
|
||||||
public static final String
|
public static final String
|
||||||
DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_TIMEOUT =
|
DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_TIMEOUT =
|
||||||
"dfs.container.ratis.statemachinedata.sync.timeout";
|
"dfs.container.ratis.statemachinedata.sync.timeout";
|
||||||
|
@ -90,10 +90,23 @@ public final class ScmConfigKeys {
|
||||||
"dfs.container.ratis.statemachinedata.sync.retries";
|
"dfs.container.ratis.statemachinedata.sync.retries";
|
||||||
public static final int
|
public static final int
|
||||||
DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES_DEFAULT = -1;
|
DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES_DEFAULT = -1;
|
||||||
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE =
|
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS =
|
||||||
"dfs.container.ratis.log.queue.size";
|
"dfs.container.ratis.log.queue.num-elements";
|
||||||
public static final int DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE_DEFAULT = 128;
|
public static final int DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS_DEFAULT =
|
||||||
|
1024;
|
||||||
|
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT =
|
||||||
|
"dfs.container.ratis.log.queue.byte-limit";
|
||||||
|
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT_DEFAULT =
|
||||||
|
"4GB";
|
||||||
|
public static final String
|
||||||
|
DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS =
|
||||||
|
"dfs.container.ratis.log.appender.queue.num-elements";
|
||||||
|
public static final int
|
||||||
|
DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS_DEFAULT = 1;
|
||||||
|
public static final String DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT =
|
||||||
|
"dfs.container.ratis.log.appender.queue.byte-limit";
|
||||||
|
public static final String
|
||||||
|
DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT_DEFAULT = "32MB";
|
||||||
// expiry interval stateMachineData cache entry inside containerStateMachine
|
// expiry interval stateMachineData cache entry inside containerStateMachine
|
||||||
public static final String
|
public static final String
|
||||||
DFS_CONTAINER_RATIS_STATEMACHINEDATA_CACHE_EXPIRY_INTERVAL =
|
DFS_CONTAINER_RATIS_STATEMACHINEDATA_CACHE_EXPIRY_INTERVAL =
|
||||||
|
|
|
@ -288,10 +288,25 @@ public final class OzoneConfigKeys {
|
||||||
public static final int
|
public static final int
|
||||||
DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES_DEFAULT =
|
DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES_DEFAULT =
|
||||||
ScmConfigKeys.DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES_DEFAULT;
|
ScmConfigKeys.DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES_DEFAULT;
|
||||||
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE =
|
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS =
|
||||||
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE;
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS;
|
||||||
public static final int DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE_DEFAULT =
|
public static final int DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS_DEFAULT =
|
||||||
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE_DEFAULT;
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS_DEFAULT;
|
||||||
|
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT =
|
||||||
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT;
|
||||||
|
public static final String DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT_DEFAULT =
|
||||||
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT_DEFAULT;
|
||||||
|
public static final String
|
||||||
|
DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS =
|
||||||
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS;
|
||||||
|
public static final int
|
||||||
|
DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS_DEFAULT =
|
||||||
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS_DEFAULT;
|
||||||
|
public static final String DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT =
|
||||||
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT;
|
||||||
|
public static final String
|
||||||
|
DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT_DEFAULT =
|
||||||
|
ScmConfigKeys.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT_DEFAULT;
|
||||||
public static final String DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY =
|
public static final String DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY =
|
||||||
ScmConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY;
|
ScmConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY;
|
||||||
public static final TimeDuration
|
public static final TimeDuration
|
||||||
|
|
|
@ -170,7 +170,7 @@ public interface RatisHelper {
|
||||||
long retryInterval = conf.getTimeDuration(OzoneConfigKeys.
|
long retryInterval = conf.getTimeDuration(OzoneConfigKeys.
|
||||||
DFS_RATIS_CLIENT_REQUEST_RETRY_INTERVAL_KEY, OzoneConfigKeys.
|
DFS_RATIS_CLIENT_REQUEST_RETRY_INTERVAL_KEY, OzoneConfigKeys.
|
||||||
DFS_RATIS_CLIENT_REQUEST_RETRY_INTERVAL_DEFAULT
|
DFS_RATIS_CLIENT_REQUEST_RETRY_INTERVAL_DEFAULT
|
||||||
.toInt(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
|
.toIntExact(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
|
||||||
TimeDuration sleepDuration =
|
TimeDuration sleepDuration =
|
||||||
TimeDuration.valueOf(retryInterval, TimeUnit.MILLISECONDS);
|
TimeDuration.valueOf(retryInterval, TimeUnit.MILLISECONDS);
|
||||||
RetryPolicy retryPolicy = RetryPolicies
|
RetryPolicy retryPolicy = RetryPolicies
|
||||||
|
|
|
@ -76,10 +76,32 @@
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>dfs.container.ratis.log.queue.size</name>
|
<name>dfs.container.ratis.log.queue.num-elements</name>
|
||||||
<value>128</value>
|
<value>1024</value>
|
||||||
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
||||||
<description>Number of operation pending with Raft's Log Worker.
|
<description>Limit for the number of operations in Ratis Log Worker.
|
||||||
|
</description>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>dfs.container.ratis.log.queue.byte-limit</name>
|
||||||
|
<value>4GB</value>
|
||||||
|
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
||||||
|
<description>Byte limit for Ratis Log Worker queue.
|
||||||
|
</description>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>dfs.container.ratis.log.appender.queue.num-elements</name>
|
||||||
|
<value>1</value>
|
||||||
|
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
||||||
|
<description>Limit for number of append entries in ratis leader's
|
||||||
|
log appender queue.
|
||||||
|
</description>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>dfs.container.ratis.log.appender.queue.byte-limit</name>
|
||||||
|
<value>32MB</value>
|
||||||
|
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
||||||
|
<description>Byte limit for ratis leader's log appender queue.
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
|
@ -191,10 +213,10 @@
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>dfs.container.ratis.segment.preallocated.size</name>
|
<name>dfs.container.ratis.segment.preallocated.size</name>
|
||||||
<value>128MB</value>
|
<value>16KB</value>
|
||||||
<tag>OZONE, RATIS, PERFORMANCE</tag>
|
<tag>OZONE, RATIS, PERFORMANCE</tag>
|
||||||
<description>The size of the buffer which is preallocated for raft segment
|
<description>The size of the buffer which is preallocated for raft segment
|
||||||
used by Apache Ratis on datanodes.(128 MB by default)
|
used by Apache Ratis on datanodes.(16 KB by default)
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
|
@ -1476,10 +1498,25 @@
|
||||||
|
|
||||||
<property>
|
<property>
|
||||||
<name>ozone.om.ratis.segment.preallocated.size</name>
|
<name>ozone.om.ratis.segment.preallocated.size</name>
|
||||||
<value>128MB</value>
|
<value>16KB</value>
|
||||||
<tag>OZONE, OM, RATIS, PERFORMANCE</tag>
|
<tag>OZONE, OM, RATIS, PERFORMANCE</tag>
|
||||||
<description>The size of the buffer which is preallocated for raft segment
|
<description>The size of the buffer which is preallocated for raft segment
|
||||||
used by Apache Ratis on OM.(128 MB by default)
|
used by Apache Ratis on OM.(16 KB by default)
|
||||||
|
</description>
|
||||||
|
</property>
|
||||||
|
|
||||||
|
<property>
|
||||||
|
<name>ozone.om.ratis.log.appender.queue.num-elements</name>
|
||||||
|
<value>1024</value>
|
||||||
|
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
||||||
|
<description>Number of operation pending with Raft's Log Worker.
|
||||||
|
</description>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>ozone.om.ratis.log.appender.queue.byte-limit</name>
|
||||||
|
<value>32MB</value>
|
||||||
|
<tag>OZONE, DEBUG, CONTAINER, RATIS</tag>
|
||||||
|
<description>Byte limit for Raft's Log Worker queue.
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.google.common.base.Preconditions;
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import org.apache.hadoop.hdds.HddsUtils;
|
import org.apache.hadoop.hdds.HddsUtils;
|
||||||
|
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
|
||||||
import org.apache.ratis.proto.RaftProtos.RaftPeerRole;
|
import org.apache.ratis.proto.RaftProtos.RaftPeerRole;
|
||||||
import org.apache.ratis.protocol.RaftGroup;
|
import org.apache.ratis.protocol.RaftGroup;
|
||||||
import org.apache.ratis.protocol.RaftGroupId;
|
import org.apache.ratis.protocol.RaftGroupId;
|
||||||
|
@ -388,11 +389,12 @@ public class ContainerStateMachine extends BaseStateMachine {
|
||||||
ContainerCommandRequestProto requestProto, long term, long index) {
|
ContainerCommandRequestProto requestProto, long term, long index) {
|
||||||
WriteChunkRequestProto writeChunkRequestProto =
|
WriteChunkRequestProto writeChunkRequestProto =
|
||||||
requestProto.getWriteChunk();
|
requestProto.getWriteChunk();
|
||||||
|
ContainerProtos.ChunkInfo chunkInfo = writeChunkRequestProto.getChunkData();
|
||||||
// prepare the chunk to be read
|
// prepare the chunk to be read
|
||||||
ReadChunkRequestProto.Builder readChunkRequestProto =
|
ReadChunkRequestProto.Builder readChunkRequestProto =
|
||||||
ReadChunkRequestProto.newBuilder()
|
ReadChunkRequestProto.newBuilder()
|
||||||
.setBlockID(writeChunkRequestProto.getBlockID())
|
.setBlockID(writeChunkRequestProto.getBlockID())
|
||||||
.setChunkData(writeChunkRequestProto.getChunkData());
|
.setChunkData(chunkInfo);
|
||||||
ContainerCommandRequestProto dataContainerCommandProto =
|
ContainerCommandRequestProto dataContainerCommandProto =
|
||||||
ContainerCommandRequestProto.newBuilder(requestProto)
|
ContainerCommandRequestProto.newBuilder(requestProto)
|
||||||
.setCmdType(Type.ReadChunk)
|
.setCmdType(Type.ReadChunk)
|
||||||
|
@ -411,7 +413,11 @@ public class ContainerStateMachine extends BaseStateMachine {
|
||||||
|
|
||||||
ByteString data = responseProto.getData();
|
ByteString data = responseProto.getData();
|
||||||
// assert that the response has data in it.
|
// assert that the response has data in it.
|
||||||
Preconditions.checkNotNull(data);
|
Preconditions
|
||||||
|
.checkNotNull(data, "read chunk data is null for chunk:" + chunkInfo);
|
||||||
|
Preconditions.checkState(data.size() == chunkInfo.getLen(), String.format(
|
||||||
|
"read chunk len=%d does not match chunk expected len=%d for chunk:%s",
|
||||||
|
data.size(), chunkInfo.getLen(), chunkInfo));
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,8 +175,19 @@ public final class XceiverServerRatis implements XceiverServerSpi {
|
||||||
OzoneConfigKeys.DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY,
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY,
|
||||||
OzoneConfigKeys.DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT,
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT,
|
||||||
StorageUnit.BYTES);
|
StorageUnit.BYTES);
|
||||||
RaftServerConfigKeys.Log.Appender.setBufferCapacity(properties,
|
int logAppenderQueueNumElements = conf.getInt(
|
||||||
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS,
|
||||||
|
OzoneConfigKeys
|
||||||
|
.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS_DEFAULT);
|
||||||
|
final int logAppenderQueueByteLimit = (int) conf.getStorageSize(
|
||||||
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT,
|
||||||
|
OzoneConfigKeys
|
||||||
|
.DFS_CONTAINER_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT_DEFAULT,
|
||||||
|
StorageUnit.BYTES);
|
||||||
|
RaftServerConfigKeys.Log.Appender
|
||||||
|
.setBufferElementLimit(properties, logAppenderQueueNumElements);
|
||||||
|
RaftServerConfigKeys.Log.Appender.setBufferByteLimit(properties,
|
||||||
|
SizeInBytes.valueOf(logAppenderQueueByteLimit));
|
||||||
RaftServerConfigKeys.Log.setPreallocatedSize(properties,
|
RaftServerConfigKeys.Log.setPreallocatedSize(properties,
|
||||||
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
||||||
|
|
||||||
|
@ -255,8 +266,6 @@ public final class XceiverServerRatis implements XceiverServerSpi {
|
||||||
leaderElectionMinTimeout.toLong(TimeUnit.MILLISECONDS) + 200;
|
leaderElectionMinTimeout.toLong(TimeUnit.MILLISECONDS) + 200;
|
||||||
RaftServerConfigKeys.Rpc.setTimeoutMax(properties,
|
RaftServerConfigKeys.Rpc.setTimeoutMax(properties,
|
||||||
TimeDuration.valueOf(leaderElectionMaxTimeout, TimeUnit.MILLISECONDS));
|
TimeDuration.valueOf(leaderElectionMaxTimeout, TimeUnit.MILLISECONDS));
|
||||||
// Enable batch append on raft server
|
|
||||||
RaftServerConfigKeys.Log.Appender.setBatchEnabled(properties, true);
|
|
||||||
|
|
||||||
// Set the maximum cache segments
|
// Set the maximum cache segments
|
||||||
RaftServerConfigKeys.Log.setMaxCachedSegmentNum(properties, 2);
|
RaftServerConfigKeys.Log.setMaxCachedSegmentNum(properties, 2);
|
||||||
|
@ -299,10 +308,15 @@ public final class XceiverServerRatis implements XceiverServerSpi {
|
||||||
setAutoTriggerEnabled(properties, true);
|
setAutoTriggerEnabled(properties, true);
|
||||||
RaftServerConfigKeys.Snapshot.
|
RaftServerConfigKeys.Snapshot.
|
||||||
setAutoTriggerThreshold(properties, snapshotThreshold);
|
setAutoTriggerThreshold(properties, snapshotThreshold);
|
||||||
int logQueueSize =
|
int logQueueNumElements =
|
||||||
conf.getInt(OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE,
|
conf.getInt(OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS,
|
||||||
OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_SIZE_DEFAULT);
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_NUM_ELEMENTS_DEFAULT);
|
||||||
RaftServerConfigKeys.Log.setQueueSize(properties, logQueueSize);
|
final int logQueueByteLimit = (int) conf.getStorageSize(
|
||||||
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT,
|
||||||
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_LOG_QUEUE_BYTE_LIMIT_DEFAULT,
|
||||||
|
StorageUnit.BYTES);
|
||||||
|
RaftServerConfigKeys.Log.setElementLimit(properties, logQueueNumElements);
|
||||||
|
RaftServerConfigKeys.Log.setByteLimit(properties, logQueueByteLimit);
|
||||||
|
|
||||||
int numSyncRetries = conf.getInt(
|
int numSyncRetries = conf.getInt(
|
||||||
OzoneConfigKeys.DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES,
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_STATEMACHINEDATA_SYNC_RETRIES,
|
||||||
|
@ -409,7 +423,7 @@ public final class XceiverServerRatis implements XceiverServerSpi {
|
||||||
RaftClientReply reply;
|
RaftClientReply reply;
|
||||||
RaftClientRequest raftClientRequest =
|
RaftClientRequest raftClientRequest =
|
||||||
createRaftClientRequest(request, pipelineID,
|
createRaftClientRequest(request, pipelineID,
|
||||||
RaftClientRequest.writeRequestType(replicationLevel));
|
RaftClientRequest.writeRequestType());
|
||||||
try {
|
try {
|
||||||
reply = server.submitClientRequestAsync(raftClientRequest).get();
|
reply = server.submitClientRequestAsync(raftClientRequest).get();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<hdds.version>0.4.0-SNAPSHOT</hdds.version>
|
<hdds.version>0.4.0-SNAPSHOT</hdds.version>
|
||||||
|
|
||||||
<!-- Apache Ratis version -->
|
<!-- Apache Ratis version -->
|
||||||
<ratis.version>0.4.0-b600fc2-SNAPSHOT</ratis.version>
|
<ratis.version>0.4.0-3b0be02-SNAPSHOT</ratis.version>
|
||||||
|
|
||||||
<bouncycastle.version>1.60</bouncycastle.version>
|
<bouncycastle.version>1.60</bouncycastle.version>
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.ratis.protocol.RaftGroupId;
|
||||||
import org.apache.ratis.protocol.RaftPeer;
|
import org.apache.ratis.protocol.RaftPeer;
|
||||||
import org.apache.ratis.retry.RetryPolicy;
|
import org.apache.ratis.retry.RetryPolicy;
|
||||||
import org.apache.ratis.rpc.SupportedRpcType;
|
import org.apache.ratis.rpc.SupportedRpcType;
|
||||||
import org.apache.ratis.util.CheckedBiConsumer;
|
import org.apache.ratis.util.function.CheckedBiConsumer;
|
||||||
import org.apache.ratis.util.TimeDuration;
|
import org.apache.ratis.util.TimeDuration;
|
||||||
import org.apache.ratis.util.TimeoutScheduler;
|
import org.apache.ratis.util.TimeoutScheduler;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -121,7 +121,19 @@ public final class OMConfigKeys {
|
||||||
public static final String OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY
|
public static final String OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY
|
||||||
= "ozone.om.ratis.segment.preallocated.size";
|
= "ozone.om.ratis.segment.preallocated.size";
|
||||||
public static final String OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT
|
public static final String OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT
|
||||||
= "128MB";
|
= "16KB";
|
||||||
|
|
||||||
|
// OM Ratis Log Appender configurations
|
||||||
|
public static final String
|
||||||
|
OZONE_OM_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS =
|
||||||
|
"ozone.om.ratis.log.appender.queue.num-elements";
|
||||||
|
public static final int
|
||||||
|
OZONE_OM_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS_DEFAULT = 1024;
|
||||||
|
public static final String OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT =
|
||||||
|
"ozone.om.ratis.log.appender.queue.byte-limit";
|
||||||
|
public static final String
|
||||||
|
OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT_DEFAULT = "32MB";
|
||||||
|
|
||||||
|
|
||||||
// OM Ratis server configurations
|
// OM Ratis server configurations
|
||||||
public static final String OZONE_OM_RATIS_SERVER_REQUEST_TIMEOUT_KEY
|
public static final String OZONE_OM_RATIS_SERVER_REQUEST_TIMEOUT_KEY
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.hadoop.hdds.scm.container.ContainerID;
|
||||||
import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
|
import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
|
||||||
import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo;
|
import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo;
|
||||||
import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfoGroup;
|
import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfoGroup;
|
||||||
import org.apache.ratis.util.CheckedConsumer;
|
import org.apache.ratis.util.function.CheckedConsumer;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -49,7 +49,7 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration;
|
||||||
|
|
||||||
import static org.apache.ratis.rpc.SupportedRpcType.GRPC;
|
import static org.apache.ratis.rpc.SupportedRpcType.GRPC;
|
||||||
import org.apache.ratis.protocol.RaftGroupId;
|
import org.apache.ratis.protocol.RaftGroupId;
|
||||||
import org.apache.ratis.util.CheckedBiConsumer;
|
import org.apache.ratis.util.function.CheckedBiConsumer;
|
||||||
|
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.hadoop.hdds.scm.XceiverClientSpi;
|
||||||
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
|
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
|
||||||
import org.apache.ratis.rpc.RpcType;
|
import org.apache.ratis.rpc.RpcType;
|
||||||
import org.apache.ratis.rpc.SupportedRpcType;
|
import org.apache.ratis.rpc.SupportedRpcType;
|
||||||
import org.apache.ratis.util.CheckedBiConsumer;
|
import org.apache.ratis.util.function.CheckedBiConsumer;
|
||||||
import org.apache.ratis.util.CollectionUtils;
|
import org.apache.ratis.util.CollectionUtils;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
|
|
|
@ -52,7 +52,7 @@ import org.apache.hadoop.hdds.scm.XceiverClientSpi;
|
||||||
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
|
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
|
||||||
import org.apache.hadoop.test.GenericTestUtils;
|
import org.apache.hadoop.test.GenericTestUtils;
|
||||||
import org.apache.ratis.rpc.RpcType;
|
import org.apache.ratis.rpc.RpcType;
|
||||||
import org.apache.ratis.util.CheckedBiConsumer;
|
import org.apache.ratis.util.function.CheckedBiConsumer;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
|
@ -156,8 +156,17 @@ public final class OzoneManagerRatisServer {
|
||||||
OMConfigKeys.OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY,
|
OMConfigKeys.OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_KEY,
|
||||||
OMConfigKeys.OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT,
|
OMConfigKeys.OZONE_OM_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT,
|
||||||
StorageUnit.BYTES);
|
StorageUnit.BYTES);
|
||||||
RaftServerConfigKeys.Log.Appender.setBufferCapacity(properties,
|
int logAppenderQueueNumElements = conf.getInt(
|
||||||
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS,
|
||||||
|
OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_NUM_ELEMENTS_DEFAULT);
|
||||||
|
final int logAppenderQueueByteLimit = (int) conf.getStorageSize(
|
||||||
|
OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT,
|
||||||
|
OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT_DEFAULT,
|
||||||
|
StorageUnit.BYTES);
|
||||||
|
RaftServerConfigKeys.Log.Appender
|
||||||
|
.setBufferElementLimit(properties, logAppenderQueueNumElements);
|
||||||
|
RaftServerConfigKeys.Log.Appender.setBufferByteLimit(properties,
|
||||||
|
SizeInBytes.valueOf(logAppenderQueueByteLimit));
|
||||||
RaftServerConfigKeys.Log.setPreallocatedSize(properties,
|
RaftServerConfigKeys.Log.setPreallocatedSize(properties,
|
||||||
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
||||||
|
|
||||||
|
@ -165,7 +174,7 @@ public final class OzoneManagerRatisServer {
|
||||||
// TODO: calculate the max message size based on the max size of a
|
// TODO: calculate the max message size based on the max size of a
|
||||||
// PutSmallFileRequest's file size limit
|
// PutSmallFileRequest's file size limit
|
||||||
GrpcConfigKeys.setMessageSizeMax(properties,
|
GrpcConfigKeys.setMessageSizeMax(properties,
|
||||||
SizeInBytes.valueOf(raftSegmentPreallocatedSize));
|
SizeInBytes.valueOf(logAppenderQueueByteLimit));
|
||||||
|
|
||||||
// Set the server request timeout
|
// Set the server request timeout
|
||||||
TimeUnit serverRequestTimeoutUnit =
|
TimeUnit serverRequestTimeoutUnit =
|
||||||
|
@ -209,9 +218,6 @@ public final class OzoneManagerRatisServer {
|
||||||
RaftServerConfigKeys.Rpc.setTimeoutMax(properties,
|
RaftServerConfigKeys.Rpc.setTimeoutMax(properties,
|
||||||
serverMaxTimeout);
|
serverMaxTimeout);
|
||||||
|
|
||||||
// Enable batch append on raft server
|
|
||||||
RaftServerConfigKeys.Log.Appender.setBatchEnabled(properties, true);
|
|
||||||
|
|
||||||
// Set the number of maximum cached segments
|
// Set the number of maximum cached segments
|
||||||
RaftServerConfigKeys.Log.setMaxCachedSegmentNum(properties, 2);
|
RaftServerConfigKeys.Log.setMaxCachedSegmentNum(properties, 2);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<hadoop.version>3.2.1-SNAPSHOT</hadoop.version>
|
<hadoop.version>3.2.1-SNAPSHOT</hadoop.version>
|
||||||
<hdds.version>0.4.0-SNAPSHOT</hdds.version>
|
<hdds.version>0.4.0-SNAPSHOT</hdds.version>
|
||||||
<ozone.version>0.4.0-SNAPSHOT</ozone.version>
|
<ozone.version>0.4.0-SNAPSHOT</ozone.version>
|
||||||
<ratis.version>0.4.0-b600fc2-SNAPSHOT</ratis.version>
|
<ratis.version>0.4.0-3b0be02-SNAPSHOT</ratis.version>
|
||||||
<bouncycastle.version>1.60</bouncycastle.version>
|
<bouncycastle.version>1.60</bouncycastle.version>
|
||||||
<ozone.release>Badlands</ozone.release>
|
<ozone.release>Badlands</ozone.release>
|
||||||
<declared.ozone.version>${ozone.version}</declared.ozone.version>
|
<declared.ozone.version>${ozone.version}</declared.ozone.version>
|
||||||
|
|
Loading…
Reference in New Issue