Skip to content

Commit e34f417

Browse files
HDDS-15065. Reduce Ratis snapshot gap to fix SCM flush delay.
1 parent 0039ce6 commit e34f417

6 files changed

Lines changed: 3 additions & 22 deletions

File tree

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ScmConfigKeys.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,6 @@ public final class ScmConfigKeys {
584584
public static final long OZONE_SCM_HA_RATIS_SNAPSHOT_THRESHOLD_DEFAULT =
585585
1000L;
586586

587-
/**
588-
* the config will transfer value to ratis config
589-
* raft.server.snapshot.creation.gap, used by ratis to take snapshot
590-
* when manual trigger using api.
591-
*/
592-
public static final String OZONE_SCM_HA_RATIS_SNAPSHOT_GAP
593-
= "ozone.scm.ha.ratis.server.snapshot.creation.gap";
594-
public static final long OZONE_SCM_HA_RATIS_SNAPSHOT_GAP_DEFAULT =
595-
1024L;
596587
public static final String OZONE_SCM_HA_RATIS_SNAPSHOT_DIR =
597588
"ozone.scm.ha.ratis.snapshot.dir";
598589

hadoop-hdds/common/src/main/resources/ozone-default.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4182,12 +4182,6 @@
41824182
topology cluster tree from SCM.
41834183
</description>
41844184
</property>
4185-
<property>
4186-
<name>ozone.scm.ha.ratis.server.snapshot.creation.gap</name>
4187-
<value>1024</value>
4188-
<tag>SCM, OZONE</tag>
4189-
<description>Raft snapshot gap index after which snapshot can be taken.</description>
4190-
</property>
41914185
<property>
41924186
<name>ozone.scm.ha.dbtransactionbuffer.flush.interval</name>
41934187
<value>60s</value>

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/RatisUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
*/
5555
public final class RatisUtil {
5656

57+
public static final long SCM_RAFT_SNAPSHOT_GAP = 1L;
58+
5759
private RatisUtil() {
5860
}
5961

@@ -231,9 +233,7 @@ private static void setRaftSnapshotProperties(
231233
Snapshot.setAutoTriggerThreshold(properties,
232234
ozoneConf.getLong(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_THRESHOLD,
233235
ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_THRESHOLD_DEFAULT));
234-
Snapshot.setCreationGap(properties,
235-
ozoneConf.getLong(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_GAP,
236-
ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_GAP_DEFAULT));
236+
Snapshot.setCreationGap(properties, SCM_RAFT_SNAPSHOT_GAP);
237237
}
238238

239239
public static void checkRatisException(IOException e, String port,

hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpoint.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.apache.hadoop.hdds.client.ReplicationFactor.THREE;
2424
import static org.apache.hadoop.hdds.client.ReplicationType.RATIS;
2525
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL;
26-
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_GAP;
2726
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL;
2827
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL;
2928
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_DIR_DELETING_SERVICE_INTERVAL;
@@ -130,7 +129,6 @@ public static void setup() throws Exception {
130129
conf.setTimeDuration(OZONE_DIR_DELETING_SERVICE_INTERVAL, 100, TimeUnit.MILLISECONDS);
131130
conf.setTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, 100, TimeUnit.MILLISECONDS);
132131
conf.setTimeDuration(OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL, 100, TimeUnit.MILLISECONDS);
133-
conf.setLong(OZONE_SCM_HA_RATIS_SNAPSHOT_GAP, 1L);
134132
conf.setTimeDuration(HDDS_HEARTBEAT_INTERVAL, 50, TimeUnit.MILLISECONDS);
135133
conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 200, TimeUnit.MILLISECONDS);
136134
conf.setTimeDuration(OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL, 500, TimeUnit.MILLISECONDS);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestDatanodeSCMNodesReconfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public void init() throws Exception {
7474
conf.set(ScmConfigKeys.OZONE_SCM_PIPELINE_CREATION_INTERVAL, "10s");
7575
conf.set(ScmConfigKeys.OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL,
7676
"5s");
77-
conf.set(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_GAP, "1");
7877
conf.setTimeDuration(OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL, 100,
7978
MILLISECONDS);
8079
conf.setTimeDuration(HDDS_HEARTBEAT_INTERVAL, 1, SECONDS);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public void init() throws Exception {
5353
conf.set(ScmConfigKeys.OZONE_SCM_PIPELINE_CREATION_INTERVAL, "10s");
5454
conf.set(ScmConfigKeys.OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL,
5555
"5s");
56-
conf.set(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_GAP, "1");
5756
cluster = MiniOzoneCluster.newHABuilder(conf)
5857
.setOMServiceId("om-service-test1")
5958
.setSCMServiceId("scm-service-test1")

0 commit comments

Comments
 (0)