Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Create commit groups in commit service offer in RewriteDataFilesCommitManager #6539

Merged

Conversation

singhpk234
Copy link
Contributor

@singhpk234 singhpk234 commented Jan 7, 2023

About the change

Implements the idea proposed in #6367

Testing done

Existing UT's

cc @RussellSpitzer @flyrain

@github-actions github-actions bot added the core label Jan 7, 2023
@singhpk234 singhpk234 force-pushed the opt/rewrite-grp-creation-in-offer branch from 4c373c1 to 8ea8bb8 Compare January 8, 2023 06:12
@singhpk234 singhpk234 changed the title [WIP] Core: Create commit groups in commit service offer in RewriteDataFilesCommitManager Core: Create commit groups in commit service offer in RewriteDataFilesCommitManager Jan 9, 2023
@singhpk234 singhpk234 force-pushed the opt/rewrite-grp-creation-in-offer branch from 8ea8bb8 to 5476e70 Compare January 9, 2023 17:01
@jackye1995
Copy link
Contributor

Is there any new test case we can add to ensure correctness of this?

@singhpk234
Copy link
Contributor Author

Sure @jackye1995, presently I didn't add new ut's to this pr as the ut i was thinking of adding :

  1. make sure a batch is not commited twice
  2. if number of rewrites are not a multiple of batch size, making sure all the rewrites are already committed
    were already present as part of existing UT's, Happy to add / think for more UT's if the above cases on top of my mind are not sufficient.

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

looks good to me

@@ -264,5 +253,35 @@ public void close() {
"File groups offered after service was closed, "
+ "they were not successfully committed.");
}

private void commitReadyCommitGroups() {
if (canCreateCommitGroup()) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good way to do things, I was considering having some kind of atomic countdown but I like this as well

Copy link
Member

@RussellSpitzer RussellSpitzer left a comment

Choose a reason for hiding this comment

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

Question on the size of the Synchronization block

@singhpk234 singhpk234 force-pushed the opt/rewrite-grp-creation-in-offer branch from 8476fa7 to 30d48d5 Compare January 12, 2023 21:42
Copy link
Member

@RussellSpitzer RussellSpitzer left a comment

Choose a reason for hiding this comment

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

Looks good to me now!

@RussellSpitzer RussellSpitzer merged commit 6580a0d into apache:master Jan 12, 2023
@RussellSpitzer
Copy link
Member

Thanks @singhpk234 for the code, and @jackye1995 for the review!

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.

3 participants