-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[optimize](table stat) Reduce lock when get table statistics #39807
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
@@ -148,6 +150,8 @@ public enum OlapTableState { | |||
|
|||
private TableProperty tableProperty; | |||
|
|||
private volatile Statistics statistics = new Statistics(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When fe restarted, the statistics
has not inited and the dataSize will be 0. At this point, createTable
behavior will not be restricted.
Should we deal with this situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discuss, if statistics is not inited, we should try init it first.
But I think we may first implement this logic in master branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Proposed changes
Issue Number: this pr will pick part of #35457 to reduce the potential of dead lock with following example:
This deadlock situation usually occurs when it is a fair lock. So we should optimize the read lock.
This PR places the updates of table statistics(such as data size/replica count) in the Table Stats Thread to be done on a scheduled basis, so that there is no need to add a read lock when obtaining table statistics.