Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,23 @@
its log segments after taking snapshot.
</description>
</property>

<property>
<name>ozone.om.ratis.log.purge.upto.snapshot.index</name>
<value>true</value>
<tag>OZONE, OM, RATIS</tag>
<description>
Enable/disable Raft server to purge its log up to the snapshot index
after taking snapshot.
</description>
</property>
<property>
<name>ozone.om.ratis.log.purge.preservation.log.num</name>
<value>0</value>
<tag>OZONE, OM, RATIS</tag>
<description>
The number of latest Raft logs to not be purged after taking snapshot.
</description>
</property>
<property>
<name>ozone.om.ratis.server.request.timeout</name>
<value>3s</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ private OMConfigKeys() {
public static final String OZONE_OM_RATIS_LOG_PURGE_GAP =
"ozone.om.ratis.log.purge.gap";
public static final int OZONE_OM_RATIS_LOG_PURGE_GAP_DEFAULT = 1000000;
public static final String OZONE_OM_RATIS_LOG_PURGE_UPTO_SNAPSHOT_INDEX
= "ozone.om.ratis.log.purge.upto.snapshot.index";
public static final boolean
OZONE_OM_RATIS_LOG_PURGE_UPTO_SNAPSHOT_INDEX_DEFAULT = true;
public static final String
OZONE_OM_RATIS_LOG_PURGE_PRESERVATION_LOG_NUM
= "ozone.om.ratis.log.purge.preservation.log.num";
public static final long
OZONE_OM_RATIS_LOG_PURGE_PRESERVATION_LOG_NUM_DEFAULT = 0L;

public static final String OZONE_OM_RATIS_SNAPSHOT_AUTO_TRIGGER_THRESHOLD_KEY
= "ozone.om.ratis.snapshot.auto.trigger.threshold";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,21 @@ private RaftProperties newRaftProperties(ConfigurationSource conf) {
StorageUnit.BYTES);
RaftServerConfigKeys.Log.setSegmentSizeMax(properties,
SizeInBytes.valueOf(raftSegmentSize));
RaftServerConfigKeys.Log.setPurgeUptoSnapshotIndex(properties, true);

// Set to enable RAFT to purge logs up to Snapshot Index
RaftServerConfigKeys.Log.setPurgeUptoSnapshotIndex(properties,
conf.getBoolean(
OMConfigKeys.OZONE_OM_RATIS_LOG_PURGE_UPTO_SNAPSHOT_INDEX,
OMConfigKeys.OZONE_OM_RATIS_LOG_PURGE_UPTO_SNAPSHOT_INDEX_DEFAULT
)
);
// Set number of last RAFT logs to not be purged
RaftServerConfigKeys.Log.setPurgePreservationLogNum(properties,
conf.getLong(
OMConfigKeys.OZONE_OM_RATIS_LOG_PURGE_PRESERVATION_LOG_NUM,
OMConfigKeys.OZONE_OM_RATIS_LOG_PURGE_PRESERVATION_LOG_NUM_DEFAULT
)
);

// Set RAFT segment pre-allocated size
final long raftSegmentPreallocatedSize = (long) conf.getStorageSize(
Expand Down