Skip to content

HDDS-1638. Implement Key Write Requests to use Cache and DoubleBuffer. - #956

Merged
bharatviswa504 merged 9 commits into
apache:trunkfrom
bharatviswa504:HDDS-1638
Jun 27, 2019
Merged

HDDS-1638. Implement Key Write Requests to use Cache and DoubleBuffer.#956
bharatviswa504 merged 9 commits into
apache:trunkfrom
bharatviswa504:HDDS-1638

Conversation

@bharatviswa504

@bharatviswa504bharatviswa504 commented Jun 13, 2019

Copy link
Copy Markdown
Contributor

Implement Key write requests to use OM Cache, double buffer.

In this Jira will add the changes to implement key operations, and HA/Non-HA will have a different code path, but once all requests are implemented will have a single code path.

@hadoop-yetus

This comment has been minimized.

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

Added tests for the classes.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@hanishakoneruhanishakoneru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bharatviswa504 , posting my initial review comments.
I am yet to review some of the KeyRequests and the unit tests.

Comment threadhadoop-ozone/common/src/main/proto/OzoneManagerProtocol.proto Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Precondition checks can be removed from all the KeyRequest classes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Added these checks as these are independent request classes. This will help in detecting errors when some one uses wrongly these classes. Let me know if you still want to remove it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this mean any OM can talk to SCM to get blocks?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AllocatedBlocks from non leader OM will not be used. Block numbers will be left unused.
Should we add a leader check before allocating blocks?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

As discussed offline, we will add a isLeader check before calling preExecute. This will help in reducing the chance of allocating blocks on follower OM's.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did not understand this. How are we handling multi-part upload?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed offline, can you please add "we do not call allocateBlock in openKey for multipart upload."

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the difference between OMActions ALLOCATE_KEY and CREATE_KEY?
If they represent the same, we should get rid of ALLOCATE_KEY and use the other one instead. We don't have to do that as part of this Jira though,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Ya, we have both ALLOCATE_KEY, CREATE_KEY. I will remove CREATE_KEY as this is not being used anywhere.

@hanishakoneruhanishakoneru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the ClientRequests and Responses.
Unit tests review is pending.

There is a lot a common code between OMKeyRequest and KeyManagerImpl. Are you planning to clean up KeyManagerImpl in a different Jira?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed offline, can you please add "we do not call allocateBlock in openKey for multipart upload."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AllocatedBlocks from non leader OM will not be used. Block numbers will be left unused.
Should we add a leader check before allocating blocks?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is some repetitive code between all the Requests (ACL checks and audit logging). They can probably be combined in one place. We don't need to do this in this Jira. Do you want to open a new Jira for that to keep track?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Already we have a method checkAcl in OmRequest class. If we want to reduce the number of lines of code. And remaining lines of code are specific to each request. And same for auditLogging, in super class we have a method, we call that. Let me know if I am missing something here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check is performed in all OMClientResponse classes. We can move this check to a calling function.
Again, this can be done in a different Jira if thats preferred.

@bharatviswa504bharatviswa504Jun 24, 2019

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This is actually a safe guard check. Now each request/response classes are independent, self sufficient classes. If someone in the future directly uses these classes (Don't know if someone will use them) to handle those cases added the check. Right now when OMResponse Status is OK, then only response is added to OM DoubleBuffer in OzoneManagerProtocolServerSideTranslatorPB.java. And this addToDbBatch will be called from OMDoubleBuffer. So, for now, even if someone in future who implements these classes forgot to add this check, we don't see any side affects.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In future if some is calling these classes from somewhere else, they should take care of it. We cannot future proof code fully anyway :)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

If someone uses these classes and have OMResponse with error, we have guarded them. But someone writes the classes without this check, and then someone uses these classes we shall be in problem. But in our scenario with the current code, it will not be an issue.

On a side note, the reason for this check is when the response is an error, all other parameters are set to null in response classes. This is the main reason for the check.

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

AllocatedBlocks from non leader OM will not be used. Block numbers will be left unused.
Should we add a leader check before allocating blocks?

As discussed offline, added a check where we call preExecute, so that it applies to all OMRequests.

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

Thank You @hanishakoneru for the review.
I have addressed the review comments.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@bharatviswa504
bharatviswa504force-pushed the HDDS-1638 branch 2 times, most recently from d12929f to a04a454CompareJune 24, 2019 20:48
@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

Thank You @hanishakoneru for the review.
I have addressed the review comments.

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

/retest

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

This comment has been minimized.

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

Thank You @hanishakoneru for the review.
Addressed the review comments.

@hanishakoneru

Copy link
Copy Markdown
Contributor

Thanks for working on this Bharat. +1 pending CI.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec30Docker mode activated.
_ Prechecks _
+1dupname2No case conflicting files found.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 20 new or modified test files.
_ trunk Compile Tests _
0mvndep22Maven dependency ordering for branch
+1mvninstall460trunk passed
+1compile253trunk passed
+1checkstyle64trunk passed
+1mvnsite0trunk passed
+1shadedclient818branch has no errors when building and testing our client artifacts.
+1javadoc157trunk passed
0spotbugs309Used deprecated FindBugs config; considering switching to SpotBugs.
+1findbugs500trunk passed
_ Patch Compile Tests _
0mvndep35Maven dependency ordering for patch
+1mvninstall433the patch passed
+1compile258the patch passed
+1cc258the patch passed
+1javac258the patch passed
-0checkstyle41hadoop-ozone: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1mvnsite0the patch passed
+1whitespace0The patch has no whitespace issues.
+1shadedclient690patch has no errors when building and testing our client artifacts.
+1javadoc162the patch passed
+1findbugs518the patch passed
_ Other Tests _
+1unit258hadoop-hdds in the patch passed.
-1unit153hadoop-ozone in the patch failed.
+1asflicense42The patch does not generate ASF License warnings.
5125
ReasonTests
Failed junit testshadoop.ozone.om.TestBucketManagerImpl
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-956/15/artifact/out/Dockerfile
GITHUB PR#956
Optional Testsdupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle cc
unameLinux 79fb7c977b1d 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 toolmaven
Personalitypersonality/hadoop.sh
git revisiontrunk / 1ac967a
Default Java1.8.0_212
checkstylehttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/15/artifact/out/diff-checkstyle-hadoop-ozone.txt
unithttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/15/artifact/out/patch-unit-hadoop-ozone.txt
Test Resultshttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/15/testReport/
Max. process+thread count1375 (vs. ulimit of 5500)
modulesC: hadoop-hdds/common hadoop-ozone/common hadoop-ozone/integration-test hadoop-ozone/ozone-manager U: .
Console outputhttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/15/console
versionsgit=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered byApache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus

This comment has been minimized.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec194Docker mode activated.
_ Prechecks _
+1dupname1No case conflicting files found.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 20 new or modified test files.
_ trunk Compile Tests _
0mvndep104Maven dependency ordering for branch
+1mvninstall671trunk passed
+1compile318trunk passed
+1checkstyle90trunk passed
+1mvnsite0trunk passed
+1shadedclient1110branch has no errors when building and testing our client artifacts.
+1javadoc200trunk passed
0spotbugs381Used deprecated FindBugs config; considering switching to SpotBugs.
+1findbugs617trunk passed
_ Patch Compile Tests _
0mvndep41Maven dependency ordering for patch
+1mvninstall550the patch passed
+1compile318the patch passed
+1cc318the patch passed
+1javac318the patch passed
-0checkstyle52hadoop-ozone: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1mvnsite0the patch passed
+1whitespace0The patch has no whitespace issues.
+1shadedclient853patch has no errors when building and testing our client artifacts.
+1javadoc189the patch passed
-1findbugs393hadoop-ozone generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
_ Other Tests _
-1unit224hadoop-hdds in the patch failed.
-1unit247hadoop-ozone in the patch failed.
+1asflicense45The patch does not generate ASF License warnings.
6720
ReasonTests
FindBugsmodule:hadoop-ozone
Nullcheck of kv at line 522 of value previously dereferenced in org.apache.hadoop.ozone.om.OmMetadataManagerImpl.isBucketEmpty(String, String) At OmMetadataManagerImpl.java:522 of value previously dereferenced in org.apache.hadoop.ozone.om.OmMetadataManagerImpl.isBucketEmpty(String, String) At OmMetadataManagerImpl.java:[line 522]
Nullcheck of kv at line 480 of value previously dereferenced in org.apache.hadoop.ozone.om.OmMetadataManagerImpl.isVolumeEmpty(String) At OmMetadataManagerImpl.java:480 of value previously dereferenced in org.apache.hadoop.ozone.om.OmMetadataManagerImpl.isVolumeEmpty(String) At OmMetadataManagerImpl.java:[line 480]
Failed junit testshadoop.ozone.container.common.statemachine.commandhandler.TestCloseContainerCommandHandler
hadoop.ozone.om.TestS3BucketManager
hadoop.ozone.om.TestBucketManagerImpl
hadoop.ozone.om.request.bucket.TestOMBucketDeleteRequest
hadoop.ozone.om.request.volume.TestOMVolumeDeleteRequest
SubsystemReport/Notes
DockerClient=18.09.5 Server=18.09.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/artifact/out/Dockerfile
GITHUB PR#956
Optional Testsdupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle cc
unameLinux 145002bccfae 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/hadoop.sh
git revisiontrunk / 1ac967a
Default Java1.8.0_212
checkstylehttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/artifact/out/diff-checkstyle-hadoop-ozone.txt
findbugshttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/artifact/out/new-findbugs-hadoop-ozone.html
unithttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/artifact/out/patch-unit-hadoop-hdds.txt
unithttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/artifact/out/patch-unit-hadoop-ozone.txt
Test Resultshttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/testReport/
Max. process+thread count1338 (vs. ulimit of 5500)
modulesC: hadoop-hdds/common hadoop-ozone/common hadoop-ozone/integration-test hadoop-ozone/ozone-manager U: .
Console outputhttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/12/console
versionsgit=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered byApache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor


Screen Shot 2019-06-26 at 5 55 48 PM

@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

Thank You @hanishakoneru for the review.
Will fix the checkstyle issue during the commit.

As if I push another commit, we shall lose the CI run output, so attached the CI run screenshot.

@bharatviswa504
bharatviswa504 merged commit 4848280 into apache:trunkJun 27, 2019
@bharatviswa504

Copy link
Copy Markdown
ContributorAuthor

I have committed this to trunk.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec32Docker mode activated.
_ Prechecks _
+1dupname2No case conflicting files found.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 20 new or modified test files.
_ trunk Compile Tests _
0mvndep65Maven dependency ordering for branch
+1mvninstall518trunk passed
+1compile275trunk passed
+1checkstyle66trunk passed
+1mvnsite0trunk passed
+1shadedclient830branch has no errors when building and testing our client artifacts.
+1javadoc159trunk passed
0spotbugs301Used deprecated FindBugs config; considering switching to SpotBugs.
+1findbugs492trunk passed
_ Patch Compile Tests _
0mvndep34Maven dependency ordering for patch
+1mvninstall456the patch passed
+1compile253the patch passed
+1cc253the patch passed
+1javac253the patch passed
+1checkstyle74the patch passed
+1mvnsite0the patch passed
+1whitespace1The patch has no whitespace issues.
+1shadedclient642patch has no errors when building and testing our client artifacts.
-1javadoc90hadoop-ozone generated 2 new + 9 unchanged - 0 fixed = 11 total (was 9)
+1findbugs507the patch passed
_ Other Tests _
+1unit240hadoop-hdds in the patch passed.
-1unit1092hadoop-ozone in the patch failed.
+1asflicense41The patch does not generate ASF License warnings.
6104
ReasonTests
Failed junit testshadoop.ozone.client.rpc.TestWatchForCommit
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.TestMiniChaosOzoneCluster
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestFailureHandlingByClient
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
SubsystemReport/Notes
DockerClient=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-956/16/artifact/out/Dockerfile
GITHUB PR#956
Optional Testsdupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle cc
unameLinux fe48b0b91314 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 toolmaven
Personalitypersonality/hadoop.sh
git revisiontrunk / 1ac967a
Default Java1.8.0_212
javadochttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/16/artifact/out/diff-javadoc-javadoc-hadoop-ozone.txt
unithttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/16/artifact/out/patch-unit-hadoop-ozone.txt
Test Resultshttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/16/testReport/
Max. process+thread count5278 (vs. ulimit of 5500)
modulesC: hadoop-hdds/common hadoop-ozone/common hadoop-ozone/integration-test hadoop-ozone/ozone-manager U: .
Console outputhttps://builds.apache.org/job/hadoop-multibranch/job/PR-956/16/console
versionsgit=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered byApache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

bshashikant pushed a commit to bshashikant/hadoop that referenced this pull request Jul 10, 2019
shanthoosh pushed a commit to shanthoosh/hadoop that referenced this pull request Oct 15, 2019
* Flatten startpoint key when serialized.
* Provide custom JsonSerializer for StartpointKey.
amahussein pushed a commit to amahussein/hadoop that referenced this pull request Oct 29, 2019
Sign up for freeto 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.

3 participants

@bharatviswa504@hadoop-yetus@hanishakoneru