-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Support setting replica quota in db level #3283
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
Conversation
|
@caiconghui |
docs/documentation/cn/sql-reference/sql-statements/Data Definition/ALTER DATABASE.md
Show resolved
Hide resolved
| fullNameToDb.put(newFullDbName, db); | ||
|
|
||
| DatabaseInfo dbInfo = new DatabaseInfo(fullDbName, newFullDbName, -1L); | ||
| DatabaseInfo dbInfo = new DatabaseInfo(fullDbName, newFullDbName, -1L, QuotaType.DATA); |
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.
How about change QuotaType.DATA to null? For better understanding?
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.
@morningman null may cause NullPointerException, so I use QuotaType.NONE instead of null
fe/src/main/java/org/apache/doris/common/proc/TablesProcDir.java
Outdated
Show resolved
Hide resolved
| public static int shortkey_max_column_count = 3; | ||
| public static int shortkey_maxsize_bytes = 36; | ||
| public static long default_db_data_quota_bytes = 1024 * 1024 * 1024 * 1024L; // 1TB | ||
| public static long default_db_replica_quota_size = 1000000; |
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.
The 1000000 is too small. In meituan.com, the replica number for one database has exceeded 1000000. I think your initial value 1024 * 1024 * 1024 is OK.
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.
Why not set -1 as default value, which means no limit?
Otherwise I'm afraid some cluster can't create table after cluster upgrade.
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.
OK. I will change it to original default value
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.
@imay 1024 * 1024 * 1024 is a large value and enough, if one table has 100000 tablets , about 10000 tables can exits in on db?
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.
in my point of view, quota is a necessary limit for resource usage, the resource is limited, replica quota should like data quota, not set to be -1 @imay
morningman
left a comment
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
morningman
left a comment
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.
the syntax file
morningman
left a comment
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
This PR is to limit the replica usage, admin need to know the replica usage for every db and table, be able to set replica quota for every db. ``` ALTER DATABASE db_name SET REPLICA QUOTA quota; ```
This PR is to limit the replica usage, admin need to know the replica usage for every db and table, be able to set replica quota for every db.