@@ -216,8 +216,9 @@ func NewSeparateProcessTenantServer(
216
216
return spanconfiglimiter .New (ie , st , knobs )
217
217
},
218
218
}
219
-
220
- return newTenantServer (ctx , stopper , baseCfg , sqlCfg , tenantNameContainer , deps , mtinfopb .ServiceModeExternal )
219
+ // TODO(irfansharif): hook up NewGrantCoordinatorSQL.
220
+ var noopElasticCPUGrantCoord * admission.ElasticCPUGrantCoordinator = nil
221
+ return newTenantServer (ctx , stopper , baseCfg , sqlCfg , tenantNameContainer , deps , mtinfopb .ServiceModeExternal , noopElasticCPUGrantCoord )
221
222
}
222
223
223
224
// newSharedProcessTenantServer creates a tenant-specific, SQL-only
@@ -232,6 +233,7 @@ func newSharedProcessTenantServer(
232
233
baseCfg BaseConfig ,
233
234
sqlCfg SQLConfig ,
234
235
tenantNameContainer * roachpb.TenantNameContainer ,
236
+ elastic admission.PacerFactory ,
235
237
) (* SQLServerWrapper , error ) {
236
238
if baseCfg .IDContainer .Get () == 0 {
237
239
return nil , errors .AssertionFailedf ("programming error: NewSharedProcessTenantServer called before NodeID was assigned." )
@@ -255,7 +257,7 @@ func newSharedProcessTenantServer(
255
257
return spanconfiglimiter.NoopLimiter {}
256
258
},
257
259
}
258
- return newTenantServer (ctx , stopper , baseCfg , sqlCfg , tenantNameContainer , deps , mtinfopb .ServiceModeShared )
260
+ return newTenantServer (ctx , stopper , baseCfg , sqlCfg , tenantNameContainer , deps , mtinfopb .ServiceModeShared , elastic )
259
261
}
260
262
261
263
// newTenantServer constructs a SQLServerWrapper.
@@ -269,6 +271,7 @@ func newTenantServer(
269
271
tenantNameContainer * roachpb.TenantNameContainer ,
270
272
deps tenantServerDeps ,
271
273
serviceMode mtinfopb.TenantServiceMode ,
274
+ elastic admission.PacerFactory ,
272
275
) (* SQLServerWrapper , error ) {
273
276
// TODO(knz): Make the license application a per-server thing
274
277
// instead of a global thing.
@@ -316,7 +319,7 @@ func newTenantServer(
316
319
// then rely on some mechanism to retrieve the ID from the name to
317
320
// initialize the rest of the server.
318
321
baseCfg .idProvider .SetTenantID (sqlCfg .TenantID )
319
- args , err := makeTenantSQLServerArgs (ctx , stopper , baseCfg , sqlCfg , tenantNameContainer , deps , serviceMode )
322
+ args , err := makeTenantSQLServerArgs (ctx , stopper , baseCfg , sqlCfg , tenantNameContainer , deps , serviceMode , elastic )
320
323
if err != nil {
321
324
return nil , err
322
325
}
@@ -1094,6 +1097,7 @@ func makeTenantSQLServerArgs(
1094
1097
tenantNameContainer * roachpb.TenantNameContainer ,
1095
1098
deps tenantServerDeps ,
1096
1099
serviceMode mtinfopb.TenantServiceMode ,
1100
+ elastic admission.PacerFactory ,
1097
1101
) (sqlServerArgs , error ) {
1098
1102
st := baseCfg .Settings
1099
1103
@@ -1249,7 +1253,7 @@ func makeTenantSQLServerArgs(
1249
1253
dbCtx := kv .DefaultDBContext (st , stopper )
1250
1254
dbCtx .NodeID = deps .instanceIDContainer
1251
1255
db := kv .NewDBWithContext (baseCfg .AmbientCtx , tcsFactory , clock , dbCtx )
1252
-
1256
+ db . AdmissionPacerFactory = elastic
1253
1257
rangeFeedKnobs , _ := baseCfg .TestingKnobs .RangeFeed .(* rangefeed.TestingKnobs )
1254
1258
rangeFeedFactory , err := rangefeed .NewFactory (stopper , db , st , rangeFeedKnobs )
1255
1259
if err != nil {
@@ -1326,8 +1330,6 @@ func makeTenantSQLServerArgs(
1326
1330
remoteFlowRunnerAcc := monitorAndMetrics .rootSQLMemoryMonitor .MakeBoundAccount ()
1327
1331
remoteFlowRunner := flowinfra .NewRemoteFlowRunner (baseCfg .AmbientCtx , stopper , & remoteFlowRunnerAcc )
1328
1332
1329
- // TODO(irfansharif): hook up NewGrantCoordinatorSQL.
1330
- var noopElasticCPUGrantCoord * admission.ElasticCPUGrantCoordinator = nil
1331
1333
return sqlServerArgs {
1332
1334
sqlServerOptionalKVArgs : sqlServerOptionalKVArgs {
1333
1335
nodesStatusServer : serverpb .MakeOptionalNodesStatusServer (nil ),
@@ -1382,7 +1384,7 @@ func makeTenantSQLServerArgs(
1382
1384
grpc : grpcServer ,
1383
1385
drpc : drpcServer ,
1384
1386
externalStorageBuilder : esb ,
1385
- admissionPacerFactory : noopElasticCPUGrantCoord ,
1387
+ admissionPacerFactory : elastic ,
1386
1388
rangeDescIteratorFactory : tenantConnect ,
1387
1389
tenantTimeSeriesServer : sTS ,
1388
1390
tenantCapabilitiesReader : sql .EmptySystemTenantOnly [tenantcapabilities.Reader ](),
0 commit comments