Skip to content

Conversation

@caiconghui
Copy link
Contributor

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.

@imay
Copy link
Contributor

imay commented Apr 9, 2020

@caiconghui
Better to create an issue to track this feature.
And let others discuss about it.

@caiconghui
Copy link
Contributor Author

@imay OK for #3285

@chaoyli chaoyli added this to the 0.13.0 milestone Apr 9, 2020
fullNameToDb.put(newFullDbName, db);

DatabaseInfo dbInfo = new DatabaseInfo(fullDbName, newFullDbName, -1L);
DatabaseInfo dbInfo = new DatabaseInfo(fullDbName, newFullDbName, -1L, QuotaType.DATA);
Copy link
Contributor

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?

Copy link
Contributor Author

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

caiconghui [蔡聪辉] added 2 commits April 10, 2020 13:19
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;
Copy link
Contributor

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.

Copy link
Contributor

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.

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 will change it to original default value

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

the syntax file

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit 9257535 into apache:master Apr 14, 2020
@caiconghui caiconghui deleted the replica_quota branch May 25, 2020 03:08
@EmmyMiao87 EmmyMiao87 mentioned this pull request Aug 17, 2020
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Jan 20, 2021
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; 
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants