Skip to content

Commit e3d1966

Browse files
committed
HDFS-15439. Setting dfs.mover.retry.max.attempts to negative value will retry forever. Contributed by AMC-team.
1 parent b93dd7c commit e3d1966

File tree

1 file changed

+9
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover

1 file changed

+9
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/Mover.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,17 @@ private List<StorageGroup> getTargetStorages(StorageType t) {
134134
final int maxNoMoveInterval = conf.getInt(
135135
DFSConfigKeys.DFS_MOVER_MAX_NO_MOVE_INTERVAL_KEY,
136136
DFSConfigKeys.DFS_MOVER_MAX_NO_MOVE_INTERVAL_DEFAULT);
137-
this.retryMaxAttempts = conf.getInt(
137+
final int maxAttempts = conf.getInt(
138138
DFSConfigKeys.DFS_MOVER_RETRY_MAX_ATTEMPTS_KEY,
139139
DFSConfigKeys.DFS_MOVER_RETRY_MAX_ATTEMPTS_DEFAULT);
140+
if (maxAttempts >= 0) {
141+
this.retryMaxAttempts = maxAttempts;
142+
} else {
143+
LOG.warn(DFSConfigKeys.DFS_MOVER_RETRY_MAX_ATTEMPTS_KEY + " is "
144+
+ "configured with a negative value, using default value of "
145+
+ DFSConfigKeys.DFS_MOVER_RETRY_MAX_ATTEMPTS_DEFAULT);
146+
this.retryMaxAttempts = DFSConfigKeys.DFS_MOVER_RETRY_MAX_ATTEMPTS_DEFAULT;
147+
}
140148
this.retryCount = retryCount;
141149
this.dispatcher = new Dispatcher(nnc, Collections.<String> emptySet(),
142150
Collections.<String> emptySet(), movedWinWidth, moverThreads, 0,

0 commit comments

Comments
 (0)