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
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
package org.apache.hadoop.ozone.om;

import com.google.common.base.Preconditions;
import java.time.Duration;
import org.apache.hadoop.hdds.conf.Config;
import org.apache.hadoop.hdds.conf.ConfigGroup;
import org.apache.hadoop.hdds.conf.ConfigTag;
import org.apache.hadoop.hdds.conf.ConfigType;
import org.apache.hadoop.hdds.conf.PostConstruct;
import org.apache.hadoop.hdds.conf.ReconfigurableConfig;

Expand Down Expand Up @@ -67,6 +69,22 @@ public class OmConfig extends ReconfigurableConfig {
)
private int maxUserVolumeCount;

@Config(key = "upgrade.finalization.ratis.based.timeout",
defaultValue = "30s",
type = ConfigType.TIME,
tags = {ConfigTag.OM, ConfigTag.UPGRADE},
description = "Maximum time to wait for a slow follower to be finalized" +
" through a Ratis snapshot. This is an advanced config, and needs " +
"to be changed only under a special circumstance when the leader OM" +
" has purged the finalize request from its logs, and a follower OM " +
"was down during upgrade finalization. Default is 30s."
)
private long ratisBasedFinalizationTimeout = Duration.ofSeconds(30).getSeconds();

public long getRatisBasedFinalizationTimeout() {
return ratisBasedFinalizationTimeout;
}

public boolean isFileSystemPathEnabled() {
return fileSystemPathEnabled;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -983,10 +983,9 @@ private void instantiateServices(boolean withNewSnapshot) throws IOException {
LOG.info("New OM snapshot received with higher layout version {}. " +
"Attempting to finalize current OM to that version.",
layoutVersionInDB);
OmUpgradeConfig uConf = configuration.getObject(OmUpgradeConfig.class);
upgradeFinalizer.finalizeAndWaitForCompletion(
"om-ratis-snapshot", this,
uConf.getRatisBasedFinalizationTimeout());
config.getRatisBasedFinalizationTimeout());
if (versionManager.getMetadataLayoutVersion() < layoutVersionInDB) {
throw new IOException("Unable to finalize OM to the desired layout " +
"version " + layoutVersionInDB + " present in the snapshot DB.");
Expand Down