You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/02/22 12:03:53 UTC

[GitHub] [hadoop] tomscut commented on a change in pull request #3941: HDFS-15382. Split one FsDatasetImpl lock to block pool grain locks.

tomscut commented on a change in pull request #3941:
URL: https://github.com/apache/hadoop/pull/3941#discussion_r811864144



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
##########
@@ -1850,7 +1828,8 @@ public ReplicaHandler createTemporary(StorageType storageType,
     ReplicaInfo lastFoundReplicaInfo = null;
     boolean isInPipeline = false;
     do {
-      try (AutoCloseableLock lock = datasetWriteLock.acquire()) {
+      try (AutoCloseableLock lock = lockManager.readLock(LockLevel.BLOCK_POOl,

Review comment:
       Here write lock is changed to read lock, is there any problem?

##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaMap.java
##########
@@ -184,7 +203,7 @@ void mergeAll(ReplicaMap other) {
   ReplicaInfo remove(String bpid, Block block) {
     checkBlockPool(bpid);
     checkBlock(block);
-    try (AutoCloseableLock l = writeLock.acquire()) {
+    try (AutoCloseDataSetLock l = lockManager.readLock(LockLevel.BLOCK_POOl, bpid)) {

Review comment:
       I agree with @Hexiaoqiao . We should keep the read/write lock. Once `block Pool lock` is introduced, we can discuss whether `write locks` need to be changed to `read locks` in other JIRA. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org