Skip to content

HDDS-12356. granular locking framework [rework in split] #7936

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

Closed
wants to merge 4 commits into from

Conversation

sumitagrawl
Copy link
Contributor

@sumitagrawl sumitagrawl commented Feb 20, 2025

What changes were proposed in this pull request?

Granular locking framework for OBS for existing flow. Its just framework binding code flow but pending to call the lock in respective flow.
This also involve refactoring of request handling moving few common parts to OMGateway wrt to new flow in prototype.

locking is added for external request at entry point. This provides execution of request at leader and existing flow simultaneouly without impacting for cache.

  • refer obs-locking.md for locking added for obs request (HDDS-11898. design doc leader side execution)
  • refer leader-execution.md for Step-by-step integration of existing request (interoperability)

Next PR will include:

Parent Jira:
https://issues.apache.org/jira/browse/HDDS-11900

Its Parent for Epic;
https://issues.apache.org/jira/browse/HDDS-11897

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-11900

How was this patch tested?

  • UT cases added for lock
  • Existing test cases for impact for refactoring

@szetszwo
Copy link
Contributor

... refactoring of request handling moving few common parts to OMGateway ...

@sumitagrawl , could we do the refactoring first and then add the new code? It is hard to review when refactoring and new code are mixing together.

@sumitagrawl
Copy link
Contributor Author

... refactoring of request handling moving few common parts to OMGateway ...

@sumitagrawl , could we do the refactoring first and then add the new code? It is hard to review when refactoring and new code are mixing together.

@szetszwo
Refactoring I mean,

  • Moved a portion of code from OzoneManagerProtocolServerSideTranslatorPB class to OMGateway, to include the call of lock/unlock (Its minor movement of few 50 loc)

There is no major refactoring here.

@szetszwo
Copy link
Contributor

@sumitagrawl , Why mixing code refactoring with new code in such a big and non-trivial change? It is fine for small changes but this is not.

It is actually not easy to tell if the new code is being used in the existing code.

@kerneltime kerneltime added the om-pre-ratis-execution PRs related to https://issues.apache.org/jira/browse/HDDS-11897 label Feb 25, 2025
/**
* Manage locking of volume, bucket and keys.
*/
public class OmLockOpr {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does Opr mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opr refers to operation

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename it to OmLockOperation. Otherwise, people will keep asking the same question.

@sumitagrawl
Copy link
Contributor Author

sumitagrawl commented Mar 12, 2025

@szetszwo

Raised the PR for the split of refactoring code ... #8059

will update this PR once that is merged.

@sumitagrawl sumitagrawl marked this pull request as draft March 20, 2025 05:55
@sumitagrawl sumitagrawl requested a review from adoroszlai March 20, 2025 07:06
@sumitagrawl sumitagrawl marked this pull request as ready for review March 20, 2025 07:06
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

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

@sumitagrawl , thanks for the update! I have two quick comments inlined.

/**
* Manage locking of volume, bucket and keys.
*/
public class OmLockOpr {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename it to OmLockOperation. Otherwise, people will keep asking the same question.

@@ -36,10 +40,12 @@ public class OMExecutionFlow {

private final OzoneManager ozoneManager;
private final OMPerformanceMetrics perfMetrics;
private final OmLockOpr omLockOpr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's don't change OMExecutionFlow and OMClientRequest in this PR. It is good to make it clear that this PR is not changing the existing code.

@sumitagrawl sumitagrawl changed the title HDDS-12356. granular locking framework HDDS-12356. granular locking framework [rework in split] Mar 27, 2025
@sumitagrawl sumitagrawl closed this Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
om-pre-ratis-execution PRs related to https://issues.apache.org/jira/browse/HDDS-11897
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants