-
Notifications
You must be signed in to change notification settings - Fork 3
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
Resource Isolation Feature: Extend CACHE SELECT to allow warming up backup replicas #23
base: pinterest-integration-3.3
Are you sure you want to change the base?
Conversation
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.
Looks pretty good so far, left some comments.
fe/fe-core/src/main/java/com/starrocks/qe/CacheSelectComputeNodeSelectionProperties.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/system/TabletComputeNodeMapper.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/qe/CacheSelectComputeNodeSelectionProperties.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/qe/FragmentScanRangeAssignment.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/sql/analyzer/DataCacheStmtAnalyzer.java
Show resolved
Hide resolved
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.
Question for my understanding -
Suppose we have a write group of CN nodes. Like you mentioned in the PR description, that write group would have already had a primary replica cached upon ingestion. If we wanted to have two replicas without this PR we would have to perform a check against the hash ring to verify that for a given tablet id there was already one replica cached and that check is what we want to get rid of by exposing a secondary parameter "BackupReplicas". Essentially we now delegate more granular control of caching to the system admin to remove that check against the hash ring.
If my understanding above is correct, how do I as a system admin know what combination of "DesiredReplicas" and "BackupReplicas" to issue when issuing a cache select statement. Is it mostly as simple as if the resource isolation group accepts writes then I exclusively modify "BackupReplicas"?
Close, but the hash ring itself can't actually expose whether a given key (tablet, in this case) has been mapped before. Second, we could use
Yes, this is exactly right.
Yes, this is exactly what I expect to do. |
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, thanks Anatolijs. Could we make a private build and deploy in a dev cluster and run your test suite before we merge this in?
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.
looks good
I would suggest not having the num_backup_replicas property, but having a boolean isPrimary property.
If set isPrimary as true, the primary replica will be warmed up
if not, the primary replica will not be warmed up
Either way is fine. Just my 2 cents
Why I'm doing:
Currently a cache select statement meant to bring in 2 replicas of each tablet in some resource isolation groups might look like CACHE SELECT * FROM table PROPERTIES( "resource_isolation_groups"="writegroup, async", "num_replicas"="2");
This would intend to bring in each tablet into 2 CN in writegroup, and 2 CN in async. However, there may be some situation where we just want to bring in data for fallback purposes. For example, say we have resource isolation "writegroup" which is responsible for data ingestion. As data is being ingested, it is automatically cached in the CN which is primarily responsible for each tablet. We don't need to do cache warmup for the primary replica because it's already cached, and it costs CPU to perform this noop. Instead, we'd like to issue a cache warmup such that we bring in backup replicas.
What I'm doing:
I added the following syntax to support backup replicas:
CACHE SELECT * FROM table PROPERTIES( "resource_isolation_groups"="writegroup", "num_backup_replicas"="1");
So this command will warmup the first backup replica. We could also specify num_backup_replicas=2 if we wanted 3 replicas total, etc.
https://jira.pinadmin.com/browse/RTA-6821
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: