Skip to content

Commit 1c18131

Browse files
craig[bot]aerfreitamird
committed
154409: changefeedccl: remove fixed latency checks from pts benchmark test r=asg0451,KeithCh a=aerfrei Removes the fixed threshold checks for the `changefeed_stage_pts_manage_latency` and `changefeed_stage_pts_manage_error_latency` metrics in the cdc/multi-table-pts-benchmark roachtests. These thresholds were too rigid and caused noisy failures. Issue #154447 has been filed to track the goal of monitoring these metrics via roachperf instead. Fixes: #152900 Fixes: #152903 Fixes: #153017 Fixes: #154120 Fixes: #154122 Fixes: #154132 Fixes: #154302 Fixes: #154357 Epic: CRDB-1421 Release note: None 154451: server: remove unused argument, update doc comment r=yuzefovich a=tamird - **server: remove unused argument, update doc comment** - **server: remove ancient TODO** Epic: None Co-authored-by: Aerin Freilich <[email protected]> Co-authored-by: Tamir Duberstein <[email protected]>
3 parents 6bfc8db + 598c8d5 + 3e3e908 commit 1c18131

File tree

5 files changed

+6
-57
lines changed

5 files changed

+6
-57
lines changed

pkg/cmd/roachtest/tests/cdc.go

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,14 +1880,8 @@ func runCDCMultiTablePTSBenchmark(
18801880

18811881
ct.waitForWorkload()
18821882

1883-
t.Status("workload finished, verifying metrics")
1884-
1885-
// These metrics are in nanoseconds, so we are asserting that both
1886-
// of these latency metrics are less than 25 milliseconds.
1887-
ct.verifyMetrics(ctx, ct.verifyMetricsUnderThreshold([]string{
1888-
"changefeed_stage_pts_manage_latency",
1889-
"changefeed_stage_pts_create_latency",
1890-
}, float64(30*time.Millisecond)))
1883+
// TODO(#154447): Send values of changefeed_stage_pts_manage_latency and
1884+
// changefeed_stage_pts_manage_error_latency metrics to RoachPerf.
18911885

18921886
t.Status("multi-table PTS benchmark finished")
18931887
}
@@ -4921,40 +4915,3 @@ func verifyMetricsNonZero(names ...string) func(metrics map[string]*prompb.Metri
49214915
return false
49224916
}
49234917
}
4924-
4925-
func (ct *cdcTester) verifyMetricsUnderThreshold(
4926-
names []string, threshold float64,
4927-
) func(metrics map[string]*prompb.MetricFamily) (ok bool) {
4928-
namesMap := make(map[string]struct{}, len(names))
4929-
for _, name := range names {
4930-
namesMap[name] = struct{}{}
4931-
}
4932-
4933-
return func(metrics map[string]*prompb.MetricFamily) (ok bool) {
4934-
found := map[string]struct{}{}
4935-
4936-
for name, fam := range metrics {
4937-
if _, ok := namesMap[name]; !ok {
4938-
continue
4939-
}
4940-
4941-
for _, m := range fam.Metric {
4942-
if m.Histogram.GetSampleCount() == 0 {
4943-
continue
4944-
}
4945-
4946-
observedValue := m.Histogram.GetSampleSum() / float64(m.Histogram.GetSampleCount())
4947-
if observedValue < threshold {
4948-
found[name] = struct{}{}
4949-
} else {
4950-
ct.t.Fatalf("observed value for metric %s over threshold. observedValue: %f, threshold: %f", name, observedValue, threshold)
4951-
}
4952-
}
4953-
4954-
if len(found) == len(names) {
4955-
return true
4956-
}
4957-
}
4958-
return false
4959-
}
4960-
}

pkg/server/grpc_gateway.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ var _ grpcGatewayServer = authserver.Server(nil)
3939
var _ grpcGatewayServer = (*ts.Server)(nil)
4040

4141
// configureGRPCGateway initializes services necessary for running the
42-
// GRPC Gateway services proxied against the server at `grpcSrv`.
43-
//
44-
// The connection between the reverse proxy provided by grpc-gateway
45-
// and our grpc server uses a loopback-based listener to create
46-
// connections between the two.
42+
// GRPC Gateway services proxied against the server at `grpcAddr`.
4743
//
4844
// The function returns 3 arguments that are necessary to call
4945
// `RegisterGateway` which generated for each of your gRPC services
@@ -53,8 +49,7 @@ func configureGRPCGateway(
5349
ambientCtx log.AmbientContext,
5450
rpcContext *rpc.Context,
5551
stopper *stop.Stopper,
56-
grpcSrv *grpcServer,
57-
GRPCAddr string,
52+
grpcAddr string,
5853
) (*gwruntime.ServeMux, context.Context, *grpc.ClientConn, error) {
5954
jsonpb := &protoutil.JSONPb{
6055
EnumsAsInts: true,
@@ -77,7 +72,7 @@ func configureGRPCGateway(
7772

7873
// Eschew `(*rpc.Context).GRPCDial` to avoid unnecessary moving parts on the
7974
// uniquely in-process connection.
80-
dialOpts, err := rpcContext.GRPCDialOptions(ctx, GRPCAddr, rpcbase.DefaultClass)
75+
dialOpts, err := rpcContext.GRPCDialOptions(ctx, grpcAddr, rpcbase.DefaultClass)
8176
if err != nil {
8277
return nil, nil, nil, err
8378
}
@@ -93,7 +88,7 @@ func configureGRPCGateway(
9388
telemetry.Inc(getServerEndpointCounter(method))
9489
return invoker(ctx, method, req, reply, cc, opts...)
9590
}
96-
conn, err := grpc.DialContext(ctx, GRPCAddr, append(
91+
conn, err := grpc.DialContext(ctx, grpcAddr, append(
9792
dialOpts,
9893
grpc.WithUnaryInterceptor(callCountInterceptor),
9994
)...)

pkg/server/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,6 @@ func (s *topLevelServer) PreStart(ctx context.Context) error {
17071707
s.cfg.AmbientCtx,
17081708
s.rpcContext,
17091709
s.stopper,
1710-
s.grpc,
17111710
s.cfg.AdvertiseAddr,
17121711
)
17131712
if err != nil {

pkg/server/start_listen.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ func startListenRPCAndSQL(
158158
waitForQuiesce := func(context.Context) {
159159
<-stopper.ShouldQuiesce()
160160
drpcCancel()
161-
// TODO(bdarnell): Do we need to also close the other listeners?
162161
netutil.FatalIfUnexpected(grpcL.Close())
163162
netutil.FatalIfUnexpected(grpcLoopbackL.Close())
164163
netutil.FatalIfUnexpected(drpcL.Close()) // Closing this listener is as good as closing drpcTLSL

pkg/server/tenant.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,6 @@ func (s *SQLServerWrapper) PreStart(ctx context.Context) error {
636636
s.sqlServer.cfg.AmbientCtx,
637637
s.rpcContext,
638638
s.stopper,
639-
s.grpc,
640639
s.sqlServer.cfg.AdvertiseAddr,
641640
)
642641
if err != nil {

0 commit comments

Comments
 (0)