Skip to content

Commit

Permalink
kvserver: add AdminSplit and AdminScatter to secondary tenants API
Browse files Browse the repository at this point in the history
Release Note: None
  • Loading branch information
shralex committed Jan 16, 2022
1 parent ca44523 commit 2386268
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion pkg/rpc/auth_tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ var reqMethodAllowlist = [...]bool{
roachpb.Scan: true,
roachpb.ReverseScan: true,
roachpb.EndTxn: true,
roachpb.AdminSplit: true,
roachpb.HeartbeatTxn: true,
roachpb.QueryTxn: true,
roachpb.QueryIntent: true,
roachpb.InitPut: true,
roachpb.AddSSTable: true,
roachpb.Export: true,
roachpb.AdminScatter: true,
roachpb.AddSSTable: true,
roachpb.Refresh: true,
roachpb.RefreshRange: true,
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/rpc/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,33 +251,33 @@ func TestTenantAuthRequest(t *testing.T) {
req: &roachpb.BatchRequest{Requests: makeReqs(
makeAdminReq("a"),
)},
expErr: `request \[1 AdmSplit\] not permitted`,
expErr: `requested key span a{-\\x00} not fully contained in tenant keyspace /Tenant/1{0-1}`,
},
{
req: &roachpb.BatchRequest{Requests: makeReqs(
makeAdminReq(prefix(10, "a")),
)},
expErr: `request \[1 AdmSplit\] not permitted`,
expErr: noError,
},
{
req: &roachpb.BatchRequest{Requests: makeReqs(
makeAdminReq(prefix(50, "a")),
)},
expErr: `request \[1 AdmSplit\] not permitted`,
expErr: `requested key span /Tenant/50"a{"-\\x00"} not fully contained in tenant keyspace /Tenant/1{0-1}`,
},
{
req: &roachpb.BatchRequest{Requests: makeReqs(
makeAdminReq(prefix(10, "a")),
makeReq(prefix(10, "a"), prefix(10, "b")),
)},
expErr: `request \[1 Scan, 1 AdmSplit\] not permitted`,
expErr: noError,
},
{
req: &roachpb.BatchRequest{Requests: makeReqs(
makeReq(prefix(10, "a"), prefix(10, "b")),
makeAdminReq(prefix(10, "a")),
)},
expErr: `request \[1 Scan, 1 AdmSplit\] not permitted`,
expErr: noError,
},
{
req: &roachpb.BatchRequest{Requests: makeReqs(
Expand Down

0 comments on commit 2386268

Please sign in to comment.