Skip to content

Conversation

@bharatviswa504
Copy link
Contributor

@bharatviswa504 bharatviswa504 commented Jun 26, 2019

Changes in this PR:

  1. Used new class implemented in HDDS-1723.
  2. Removed the old OzoneManagerLock.java code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if acquireLock can return true , the you can write acquiredBucketLock = acquireLock, just eliminates 2 lines of code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it..

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 31 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
0 mvndep 29 Maven dependency ordering for branch
+1 mvninstall 468 trunk passed
+1 compile 259 trunk passed
+1 checkstyle 74 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 851 branch has no errors when building and testing our client artifacts.
+1 javadoc 160 trunk passed
0 spotbugs 309 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 504 trunk passed
_ Patch Compile Tests _
0 mvndep 17 Maven dependency ordering for patch
+1 mvninstall 418 the patch passed
+1 compile 242 the patch passed
+1 javac 242 the patch passed
-0 checkstyle 34 hadoop-ozone: The patch generated 31 new + 0 unchanged - 0 fixed = 31 total (was 0)
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 641 patch has no errors when building and testing our client artifacts.
+1 javadoc 146 the patch passed
+1 findbugs 511 the patch passed
_ Other Tests _
+1 unit 241 hadoop-hdds in the patch passed.
-1 unit 1139 hadoop-ozone in the patch failed.
+1 asflicense 34 The patch does not generate ASF License warnings.
5975
Reason Tests
Failed junit tests hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/1/artifact/out/Dockerfile
GITHUB PR #1016
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux a1a9677c93a1 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / a79bdf7
Default Java 1.8.0_212
checkstyle https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/1/artifact/out/diff-checkstyle-hadoop-ozone.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/1/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/1/testReport/
Max. process+thread count 3925 (vs. ulimit of 5500)
modules C: hadoop-ozone/common hadoop-ozone/ozone-manager U: hadoop-ozone
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/1/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 32 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
0 mvndep 29 Maven dependency ordering for branch
+1 mvninstall 545 trunk passed
+1 compile 255 trunk passed
+1 checkstyle 64 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 838 branch has no errors when building and testing our client artifacts.
+1 javadoc 159 trunk passed
0 spotbugs 315 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 507 trunk passed
_ Patch Compile Tests _
0 mvndep 25 Maven dependency ordering for patch
+1 mvninstall 457 the patch passed
+1 compile 267 the patch passed
+1 javac 267 the patch passed
+1 checkstyle 65 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 598 patch has no errors when building and testing our client artifacts.
+1 javadoc 143 the patch passed
+1 findbugs 522 the patch passed
_ Other Tests _
+1 unit 261 hadoop-hdds in the patch passed.
-1 unit 1161 hadoop-ozone in the patch failed.
+1 asflicense 48 The patch does not generate ASF License warnings.
6151
Reason Tests
Failed junit tests hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.ozone.client.rpc.TestBlockOutputStreamWithFailures
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestWatchForCommit
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/2/artifact/out/Dockerfile
GITHUB PR #1016
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux b89f2de14697 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / a79bdf7
Default Java 1.8.0_212
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/2/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/2/testReport/
Max. process+thread count 5021 (vs. ulimit of 5500)
modules C: hadoop-ozone/common hadoop-ozone/ozone-manager U: hadoop-ozone
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/2/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 35 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
0 mvndep 11 Maven dependency ordering for branch
+1 mvninstall 499 trunk passed
+1 compile 247 trunk passed
+1 checkstyle 64 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 824 branch has no errors when building and testing our client artifacts.
+1 javadoc 153 trunk passed
0 spotbugs 335 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 534 trunk passed
_ Patch Compile Tests _
0 mvndep 20 Maven dependency ordering for patch
+1 mvninstall 447 the patch passed
+1 compile 261 the patch passed
+1 javac 261 the patch passed
+1 checkstyle 68 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 687 patch has no errors when building and testing our client artifacts.
+1 javadoc 153 the patch passed
+1 findbugs 556 the patch passed
_ Other Tests _
-1 unit 259 hadoop-hdds in the patch failed.
-1 unit 1066 hadoop-ozone in the patch failed.
+1 asflicense 50 The patch does not generate ASF License warnings.
6089
Reason Tests
Failed junit tests hadoop.hdds.scm.container.placement.algorithms.TestSCMContainerPlacementRackAware
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.hdds.scm.pipeline.TestRatisPipelineProvider
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/3/artifact/out/Dockerfile
GITHUB PR #1016
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux aaf1c3aa275f 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / a79bdf7
Default Java 1.8.0_212
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/3/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/3/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/3/testReport/
Max. process+thread count 4788 (vs. ulimit of 5500)
modules C: hadoop-ozone/common hadoop-ozone/ozone-manager U: hadoop-ozone
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/3/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 33 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
0 mvndep 12 Maven dependency ordering for branch
+1 mvninstall 492 trunk passed
+1 compile 234 trunk passed
+1 checkstyle 66 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 806 branch has no errors when building and testing our client artifacts.
+1 javadoc 151 trunk passed
0 spotbugs 331 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 520 trunk passed
_ Patch Compile Tests _
0 mvndep 17 Maven dependency ordering for patch
+1 mvninstall 439 the patch passed
+1 compile 246 the patch passed
+1 javac 246 the patch passed
+1 checkstyle 74 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 623 patch has no errors when building and testing our client artifacts.
+1 javadoc 151 the patch passed
+1 findbugs 551 the patch passed
_ Other Tests _
-1 unit 236 hadoop-hdds in the patch failed.
-1 unit 1398 hadoop-ozone in the patch failed.
+1 asflicense 58 The patch does not generate ASF License warnings.
6280
Reason Tests
Failed junit tests hadoop.hdds.scm.container.placement.algorithms.TestSCMContainerPlacementRackAware
hadoop.ozone.om.TestOzoneManagerHA
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.TestMiniChaosOzoneCluster
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.hdds.scm.pipeline.TestNode2PipelineMap
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/4/artifact/out/Dockerfile
GITHUB PR #1016
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 681cd324d899 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 4848280
Default Java 1.8.0_212
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/4/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/4/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/4/testReport/
Max. process+thread count 5406 (vs. ulimit of 5500)
modules C: hadoop-ozone/common hadoop-ozone/ozone-manager U: hadoop-ozone
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1016/4/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

metadataManager.getLock().acquireVolumeLock(volumeName);
metadataManager.getLock().acquireBucketLock(volumeName, bucketName);
boolean acquiredBucketLock = false;
metadataManager.getLock().acquireLock(VOLUME_LOCK, volumeName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a subtle bug here. We either need to assume that acquireLock cannot fail, or assume that it can fail.
If it cannot fail: Then the finally is simple, you can release bucket and volume lock.
if it can fail: Then it is possible the acquire volume lock is going to fail -- and there is no handling -- I am presuming that it will throw up into the calling unction and there is some sort of a handler there ? if that is the case, what will it throw ? I am not sure it can fail -- @arp7 comments?

Copy link
Contributor

@arp7 arp7 Jun 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have no option but to assume that it can fail for two reasons:

  1. Because of the following check:
  public void acquireVolumeLock(String volume) {
    // Calling thread should not hold any bucket lock.
    // You can take an Volume while holding S3 bucket lock, since
    // semantically an S3 bucket maps to the ozone volume. So we check here
    // only if ozone bucket lock is taken.
    if (hasAnyBucketLock()) {
      throw new RuntimeException(
          "Thread '" + Thread.currentThread().getName() +
              "' cannot acquire volume lock while holding bucket lock(s).");
    }
  1. The wrapped call to lockPool.borrowObject() in LockManager#lock declares that it can throw Exception. So that covers pretty much any exception under the earth.

Copy link
Contributor Author

@bharatviswa504 bharatviswa504 Jun 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If lock acquire fails, we get RunTimeException from underlying LockManager.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at this further. Failure to get volume lock is fine here. It is up to the caller to release their resources when the stack is unwound.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the entire patch however I am +1 on this particular point.

Copy link
Contributor

@anuengineer anuengineer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that lock calls can fail. So we might have some spurious calls. But it is okay.

@bharatviswa504
Copy link
Contributor Author

I reached out to @arp7 offline, he is fine with proceeding forward.
I will commit this shortly based on @anuengineer approval.

@bharatviswa504
Copy link
Contributor Author

Test failures are not related to this patch.

@bharatviswa504 bharatviswa504 merged commit 49c5e8a into apache:trunk Jun 28, 2019
@bharatviswa504
Copy link
Contributor Author

Thank You @anuengineer for the review.
I have committed this to the trunk.

bshashikant pushed a commit to bshashikant/hadoop that referenced this pull request Jul 10, 2019
shanthoosh added a commit to shanthoosh/hadoop that referenced this pull request Oct 15, 2019
…erface. (apache#1016)

* Move StartpointVisitor to SystemAdmin.
amahussein pushed a commit to amahussein/hadoop that referenced this pull request Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants