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

[#2780] Improvement(server,core): Move tree lock from rest api to the corresponding implementation to minimize tree lock range. #2873

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

yuqi1129
Copy link
Contributor

What changes were proposed in this pull request?

Modify the rest API and move the tree lock to the core module.

Why are the changes needed?

The rest API should not be locked entirely by a tree lock.

Fix: #2780

Does this PR introduce any user-facing change?

N/A.

How was this patch tested?

N/A.

@yuqi1129 yuqi1129 self-assigned this Apr 10, 2024
@yuqi1129 yuqi1129 closed this Apr 10, 2024
@yuqi1129 yuqi1129 reopened this Apr 10, 2024
@yuqi1129 yuqi1129 closed this Apr 11, 2024
@yuqi1129 yuqi1129 reopened this Apr 11, 2024
@yuqi1129 yuqi1129 closed this Apr 11, 2024
@yuqi1129 yuqi1129 reopened this Apr 11, 2024
});
Table loadTable = dispatcher.loadTable(tableIdent);

Partition p =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we have moved the logic about tree lock into dispatcher, for partitioning-related logic, we can't completely remove tree lock from APIs.

This seems to be not very elegant, but I can't find a better one till now.

Copy link
Contributor

Choose a reason for hiding this comment

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

The change here will possibly lead to inconsistency, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm working on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

In case of this, I would rethink the necessity of this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I have some doubts about whether PR is necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can defer this and work on others firstly.

@jerryshao
Copy link
Contributor

@yuqi1129 I'm going to close this first. We can reopen this when we feel necessary to change and have a better solution.

@jerryshao jerryshao closed this Apr 16, 2024
@yuqi1129
Copy link
Contributor Author

to

Got it

@jerryshao
Copy link
Contributor

I think you can do some fine-grained access control for the lock scope, rather than blindly wrapping the whole logic into one lock. For example, like "load fileset", you only need to lock the doWithCatalog operation, no need to lock the whole logic. For "create fileset", you can lock the catalog for property validation, and again lock the fileset for fileset creation. Can you please carefully check the code, and optimize them as possible as you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Minimize the scope of using tree lock
2 participants