@@ -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
}
@@ -1093,6 +1096,7 @@ func makeTenantSQLServerArgs(
1093
1096
tenantNameContainer * roachpb.TenantNameContainer ,
1094
1097
deps tenantServerDeps ,
1095
1098
serviceMode mtinfopb.TenantServiceMode ,
1099
+ elastic admission.PacerFactory ,
1096
1100
) (sqlServerArgs , error ) {
1097
1101
st := baseCfg .Settings
1098
1102
@@ -1248,7 +1252,7 @@ func makeTenantSQLServerArgs(
1248
1252
dbCtx := kv .DefaultDBContext (st , stopper )
1249
1253
dbCtx .NodeID = deps .instanceIDContainer
1250
1254
db := kv .NewDBWithContext (baseCfg .AmbientCtx , tcsFactory , clock , dbCtx )
1251
-
1255
+ db . AdmissionPacerFactory = elastic
1252
1256
rangeFeedKnobs , _ := baseCfg .TestingKnobs .RangeFeed .(* rangefeed.TestingKnobs )
1253
1257
rangeFeedFactory , err := rangefeed .NewFactory (stopper , db , st , rangeFeedKnobs )
1254
1258
if err != nil {
@@ -1325,8 +1329,6 @@ func makeTenantSQLServerArgs(
1325
1329
remoteFlowRunnerAcc := monitorAndMetrics .rootSQLMemoryMonitor .MakeBoundAccount ()
1326
1330
remoteFlowRunner := flowinfra .NewRemoteFlowRunner (baseCfg .AmbientCtx , stopper , & remoteFlowRunnerAcc )
1327
1331
1328
- // TODO(irfansharif): hook up NewGrantCoordinatorSQL.
1329
- var noopElasticCPUGrantCoord * admission.ElasticCPUGrantCoordinator = nil
1330
1332
return sqlServerArgs {
1331
1333
sqlServerOptionalKVArgs : sqlServerOptionalKVArgs {
1332
1334
nodesStatusServer : serverpb .MakeOptionalNodesStatusServer (nil ),
@@ -1381,7 +1383,7 @@ func makeTenantSQLServerArgs(
1381
1383
grpc : grpcServer ,
1382
1384
drpc : drpcServer ,
1383
1385
externalStorageBuilder : esb ,
1384
- admissionPacerFactory : noopElasticCPUGrantCoord ,
1386
+ admissionPacerFactory : elastic ,
1385
1387
rangeDescIteratorFactory : tenantConnect ,
1386
1388
tenantTimeSeriesServer : sTS ,
1387
1389
tenantCapabilitiesReader : sql .EmptySystemTenantOnly [tenantcapabilities.Reader ](),
0 commit comments