Hexiaoqiao commented on a change in pull request #3941:
URL: https://github.com/apache/hadoop/pull/3941#discussion_r811060744
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
##########
@@ -504,15 +503,13 @@ private void createWorkPlan(NodePlan plan) throws
DiskBalancerException {
Map<String, String> storageIDToVolBasePathMap = new HashMap<>();
FsDatasetSpi.FsVolumeReferences references;
try {
- try(AutoCloseableLock lock = this.dataset.acquireDatasetReadLock()) {
Review comment:
Just suggest to keep it and improve to #dataSetLock as other
improvement. We should create another jira to remove it if this is not
necessary now.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
##########
@@ -3654,18 +3661,21 @@ public int getVolumeCount() {
}
void stopAllDataxceiverThreads(FsVolumeImpl volume) {
- try (AutoCloseableLock lock = datasetWriteLock.acquire()) {
Review comment:
Same as comment#1.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java
##########
@@ -232,118 +232,6 @@ public void setUp() throws IOException {
assertEquals(0, dataset.getNumFailedVolumes());
}
- @Test(timeout=10000)
Review comment:
I do not get where delete this unit test here.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
##########
@@ -464,42 +427,40 @@ public AutoCloseableLock acquireDatasetReadLock() {
* Activate a volume to serve requests.
* @throws IOException if the storage UUID already exists.
*/
- private void activateVolume(
+ private synchronized void activateVolume(
Review comment:
Just suggest to add annotation to describe that we use #synchronized to
protect volume instance and use datasetLock to protect blockpool instance.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]