-
Notifications
You must be signed in to change notification settings - Fork 735
mcs: init default resource group name when access new keyspace #9393
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: lhy1024 <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -157,6 +157,20 @@ func (m *Manager) getKeyspaceResourceGroupManager(keyspaceID uint32) *keyspaceRe | |||
return m.krgms[keyspaceID] | |||
} | |||
|
|||
func (m *Manager) accessKeyspaceResourceGroupManager(keyspaceID uint32, groupName string) (*keyspaceResourceGroupManager, error) { |
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.
Do we need to add it to GetKeyspaceServiceLimiter
?
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.
No need, we can return "Not found" error if the keyspace is not inited.
Signed-off-by: lhy1024 <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9393 +/- ##
==========================================
+ Coverage 76.13% 76.21% +0.08%
==========================================
Files 478 478
Lines 74586 74733 +147
==========================================
+ Hits 56785 56957 +172
+ Misses 14272 14253 -19
+ Partials 3529 3523 -6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: lhy1024 <[email protected]>
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
Signed-off-by: lhy1024 <[email protected]>
@@ -973,7 +973,7 @@ func (suite *resourceManagerClientTestSuite) TestBasicResourceGroupCURD() { | |||
re.NoError(err) | |||
re.Contains(dresp, "Success!") | |||
_, err = cli.GetResourceGroup(suite.ctx, g.Name) | |||
re.EqualError(err, fmt.Sprintf("get resource group %v failed, rpc error: code = Unknown desc = resource group not found", g.Name)) | |||
re.EqualError(err, fmt.Sprintf("get resource group %v failed, rpc error: code = Unknown desc = [PD:resourcemanager:ErrGroupNotExists]the %v resource group does not exist", g.Name, g.Name)) |
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 has the error message here changed? Can it be kept the same as before?
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.
replace errors.New("resource group not found")
with errs.ErrResourceGroupNotExists.FastGenByArgs(req.ResourceGroupName)
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
@@ -107,7 +110,10 @@ func (s *Service) ListResourceGroups(_ context.Context, req *rmpb.ListResourceGr | |||
if err := s.checkServing(); err != nil { | |||
return nil, err | |||
} | |||
groups := s.manager.GetResourceGroupList(ExtractKeyspaceID(req.GetKeyspaceId()), req.WithRuStats) | |||
groups, err := s.manager.GetResourceGroupList(ExtractKeyspaceID(req.GetKeyspaceId()), req.WithRuStats) | |||
if err != nil { |
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.
Do we need a status code?
What problem does this PR solve?
Issue Number: ref #9296.
What is changed and how does it work?
Check List
Tests
Release note