[ 
https://issues.apache.org/jira/browse/HDFS-16888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677118#comment-17677118
 ] 

ASF GitHub Bot commented on HDFS-16888:
---------------------------------------

haiyang1987 commented on code in PR #5296:
URL: https://github.com/apache/hadoop/pull/5296#discussion_r1070772222


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -1017,12 +1017,19 @@ static private void ensurePositiveInt(int val, String 
key) {
    *
    * @param newVal - Must be a positive non-zero integer.
    */
-  public void setMaxReplicationStreams(int newVal) {
-    ensurePositiveInt(newVal,
-        DFSConfigKeys.DFS_NAMENODE_REPLICATION_MAX_STREAMS_KEY);
+  @VisibleForTesting
+  public void setMaxReplicationStreams(int newVal, boolean ensurePositiveInt) {
+    if (ensurePositiveInt) {

Review Comment:
   Thanks @tomscut help me review it.
   
   Add this judgment is for compatibility with the case set 
maxReplicationStreams is 0 in TestBlockManager.java#testFavorDecomUntilHardLimit





> BlockManager#maxReplicationStreams, replicationStreamsHardLimit, 
> blocksReplWorkMultiplier and PendingReconstructionBlocks#timeout should be 
> volatile
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-16888
>                 URL: https://issues.apache.org/jira/browse/HDFS-16888
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Haiyang Hu
>            Assignee: Haiyang Hu
>            Priority: Major
>              Labels: pull-request-available
>
> BlockManager#maxReplicationStreams, replicationStreamsHardLimit, 
> blocksReplWorkMultiplier and PendingReconstructionBlocks#timeout these 
> variables may be  writen by NameNode#reconfReplicationParameters then while 
> read by the other threads. 
> Thus they should be declared as volatile to make sure the "happens-before" 
> consistency.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to