Skip to content

Commit 511c558

Browse files
craig[bot]dtrail
committed
150633: server: plumb AC pacer support into shared process tenants r=dt a=dt This change threads the AdmissionPacerFactory from the top-level server down to shared process tenant servers, enabling elastic admission control for tenant workloads. For separate process tenants, we continue to use a noop coordinator until full SQL admission control is implemented. 150700: release: add linux-amd64-fips to GPG signing script r=rickystewart a=rail This commit adds the `linux-amd64-fips` platform to the GPG signing script for custom releases. Release note: none Epic: none Co-authored-by: David Taylor <[email protected]> Co-authored-by: Rail Aliiev <[email protected]>
3 parents a719506 + e3ffe03 + e872572 commit 511c558

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

build/teamcity/internal/cockroach/release/publish/sign-custom-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ log_into_gcloud
5353
mkdir -p artifacts
5454
cd artifacts
5555

56-
for platform in linux-amd64 linux-arm64 linux-s390x; do
56+
for platform in linux-amd64 linux-amd64-fips linux-arm64 linux-s390x; do
5757
tarball=${cockroach_archive_prefix}-${version}.${platform}.tgz
5858

5959
gsutil cp "gs://$gcs_staged_bucket/$tarball" "$tarball"

pkg/server/server_controller_new_server.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/cockroachdb/cockroach/pkg/sql/isql"
2424
"github.com/cockroachdb/cockroach/pkg/storage/fs"
2525
"github.com/cockroachdb/cockroach/pkg/util"
26+
"github.com/cockroachdb/cockroach/pkg/util/admission"
2627
"github.com/cockroachdb/cockroach/pkg/util/log"
2728
"github.com/cockroachdb/cockroach/pkg/util/netutil/addr"
2829
"github.com/cockroachdb/cockroach/pkg/util/stop"
@@ -83,7 +84,7 @@ func (s *topLevelServer) newTenantServer(
8384
// Apply the TestTenantArgs, if any.
8485
baseCfg.TestingKnobs = testArgs.Knobs
8586

86-
tenantServer, err := newTenantServerInternal(ctx, baseCfg, sqlCfg, tenantStopper, tenantNameContainer)
87+
tenantServer, err := newTenantServerInternal(ctx, baseCfg, sqlCfg, tenantStopper, tenantNameContainer, s.db.AdmissionPacerFactory)
8788
if err != nil {
8889
return nil, err
8990
}
@@ -139,6 +140,7 @@ func newTenantServerInternal(
139140
sqlCfg SQLConfig,
140141
stopper *stop.Stopper,
141142
tenantNameContainer *roachpb.TenantNameContainer,
143+
elastic admission.PacerFactory,
142144
) (*SQLServerWrapper, error) {
143145
ambientCtx := baseCfg.AmbientCtx
144146
stopper.SetTracer(baseCfg.Tracer)
@@ -150,7 +152,7 @@ func newTenantServerInternal(
150152
log.Infof(newCtx, "creating tenant server")
151153

152154
// Now instantiate the tenant server proper.
153-
return newSharedProcessTenantServer(newCtx, stopper, baseCfg, sqlCfg, tenantNameContainer)
155+
return newSharedProcessTenantServer(newCtx, stopper, baseCfg, sqlCfg, tenantNameContainer, elastic)
154156
}
155157

156158
func (s *topLevelServer) makeSharedProcessTenantConfig(

pkg/server/tenant.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ func NewSeparateProcessTenantServer(
216216
return spanconfiglimiter.New(ie, st, knobs)
217217
},
218218
}
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)
221222
}
222223

223224
// newSharedProcessTenantServer creates a tenant-specific, SQL-only
@@ -232,6 +233,7 @@ func newSharedProcessTenantServer(
232233
baseCfg BaseConfig,
233234
sqlCfg SQLConfig,
234235
tenantNameContainer *roachpb.TenantNameContainer,
236+
elastic admission.PacerFactory,
235237
) (*SQLServerWrapper, error) {
236238
if baseCfg.IDContainer.Get() == 0 {
237239
return nil, errors.AssertionFailedf("programming error: NewSharedProcessTenantServer called before NodeID was assigned.")
@@ -255,7 +257,7 @@ func newSharedProcessTenantServer(
255257
return spanconfiglimiter.NoopLimiter{}
256258
},
257259
}
258-
return newTenantServer(ctx, stopper, baseCfg, sqlCfg, tenantNameContainer, deps, mtinfopb.ServiceModeShared)
260+
return newTenantServer(ctx, stopper, baseCfg, sqlCfg, tenantNameContainer, deps, mtinfopb.ServiceModeShared, elastic)
259261
}
260262

261263
// newTenantServer constructs a SQLServerWrapper.
@@ -269,6 +271,7 @@ func newTenantServer(
269271
tenantNameContainer *roachpb.TenantNameContainer,
270272
deps tenantServerDeps,
271273
serviceMode mtinfopb.TenantServiceMode,
274+
elastic admission.PacerFactory,
272275
) (*SQLServerWrapper, error) {
273276
// TODO(knz): Make the license application a per-server thing
274277
// instead of a global thing.
@@ -316,7 +319,7 @@ func newTenantServer(
316319
// then rely on some mechanism to retrieve the ID from the name to
317320
// initialize the rest of the server.
318321
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)
320323
if err != nil {
321324
return nil, err
322325
}
@@ -1094,6 +1097,7 @@ func makeTenantSQLServerArgs(
10941097
tenantNameContainer *roachpb.TenantNameContainer,
10951098
deps tenantServerDeps,
10961099
serviceMode mtinfopb.TenantServiceMode,
1100+
elastic admission.PacerFactory,
10971101
) (sqlServerArgs, error) {
10981102
st := baseCfg.Settings
10991103

@@ -1249,7 +1253,7 @@ func makeTenantSQLServerArgs(
12491253
dbCtx := kv.DefaultDBContext(st, stopper)
12501254
dbCtx.NodeID = deps.instanceIDContainer
12511255
db := kv.NewDBWithContext(baseCfg.AmbientCtx, tcsFactory, clock, dbCtx)
1252-
1256+
db.AdmissionPacerFactory = elastic
12531257
rangeFeedKnobs, _ := baseCfg.TestingKnobs.RangeFeed.(*rangefeed.TestingKnobs)
12541258
rangeFeedFactory, err := rangefeed.NewFactory(stopper, db, st, rangeFeedKnobs)
12551259
if err != nil {
@@ -1326,8 +1330,6 @@ func makeTenantSQLServerArgs(
13261330
remoteFlowRunnerAcc := monitorAndMetrics.rootSQLMemoryMonitor.MakeBoundAccount()
13271331
remoteFlowRunner := flowinfra.NewRemoteFlowRunner(baseCfg.AmbientCtx, stopper, &remoteFlowRunnerAcc)
13281332

1329-
// TODO(irfansharif): hook up NewGrantCoordinatorSQL.
1330-
var noopElasticCPUGrantCoord *admission.ElasticCPUGrantCoordinator = nil
13311333
return sqlServerArgs{
13321334
sqlServerOptionalKVArgs: sqlServerOptionalKVArgs{
13331335
nodesStatusServer: serverpb.MakeOptionalNodesStatusServer(nil),
@@ -1382,7 +1384,7 @@ func makeTenantSQLServerArgs(
13821384
grpc: grpcServer,
13831385
drpc: drpcServer,
13841386
externalStorageBuilder: esb,
1385-
admissionPacerFactory: noopElasticCPUGrantCoord,
1387+
admissionPacerFactory: elastic,
13861388
rangeDescIteratorFactory: tenantConnect,
13871389
tenantTimeSeriesServer: sTS,
13881390
tenantCapabilitiesReader: sql.EmptySystemTenantOnly[tenantcapabilities.Reader](),

pkg/sql/row/kv_batch_fetcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var logAdmissionPacerErr = log.Every(100 * time.Millisecond)
6161
// each time we seek admission for response handling during internally submitted
6262
// low priority reads (like row-level TTL selects).
6363
var elasticCPUDurationPerLowPriReadResponse = settings.RegisterDurationSetting(
64-
settings.SystemOnly,
64+
settings.ApplicationLevel,
6565
"sqladmission.elastic_cpu.duration_per_low_pri_read_response",
6666
"controls how many CPU tokens are allotted for handling responses for internally submitted low priority reads",
6767
// NB: Experimentally, during TTL reads, we observed cumulative on-CPU time
@@ -75,7 +75,7 @@ var elasticCPUDurationPerLowPriReadResponse = settings.RegisterDurationSetting(
7575
// internally submitted low-priority reads (like row-level TTL selects)
7676
// integrate with elastic CPU control.
7777
var internalLowPriReadElasticControlEnabled = settings.RegisterBoolSetting(
78-
settings.SystemOnly,
78+
settings.ApplicationLevel,
7979
"sqladmission.low_pri_read_response_elastic_control.enabled",
8080
"determines whether the sql portion of internally submitted reads integrate with elastic CPU controller",
8181
true,

0 commit comments

Comments
 (0)