Skip to content

Commit 045a652

Browse files
craig[bot]rharding6373herkolategan
committed
149474: changefeedccl: limit bank transfers in TestCatchupScanOrdering r=rharding6373 a=rharding6373 TestCatchupScanOrdering validates changefeed ordering by having one goroutine that makes bank transfers continuously and another goroutine that validates the order in which events are received downstream. This change limits the number of bank transfers before exiting the first goroutine to 2x the number expected downstream for a successful test run. The goal is to not have a goroutine that is doing busy work that might hog CPU. Epic: none Fixes: #148565 Release note: none 149586: roachprod: fix target inverse secure flag r=golgeek a=herkolategan A small regression was introduced in #149369 which passes the incorrect secure flag to `createLabels` for `node_exporter`, `ebpf_exporter`, and `workload`, causing the metrics not to be scraped. Fixes: #149512 Epic: None Release note: None Co-authored-by: rharding6373 <[email protected]> Co-authored-by: Herko Lategan <[email protected]>
3 parents ad5c16a + 4d8e356 + fcb4bbf commit 045a652

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pkg/ccl/changefeedccl/validations_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"time"
1515

1616
"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdctest"
17-
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl"
1817
"github.com/cockroachdb/cockroach/pkg/util/ctxgroup"
1918
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
2019
"github.com/cockroachdb/cockroach/pkg/util/log"
@@ -26,12 +25,12 @@ import (
2625
func TestCatchupScanOrdering(t *testing.T) {
2726
defer leaktest.AfterTest(t)()
2827
defer log.Scope(t).Close(t)
29-
defer utilccl.TestingEnableEnterprise()()
3028

3129
testFn := func(t *testing.T, s TestServer, f cdctest.TestFeedFactory) {
3230
t.Run("bank", func(t *testing.T) {
3331
ctx := context.Background()
3432
const numRows, numRanges, payloadBytes, maxTransfer = 10, 10, 10, 999
33+
const checkRows = 200
3534
gen := bank.FromConfig(numRows, numRows, payloadBytes, numRanges)
3635
var l workloadsql.InsertsDataLoader
3736
if _, err := workloadsql.Setup(ctx, s.DB, gen, l); err != nil {
@@ -62,7 +61,7 @@ func TestCatchupScanOrdering(t *testing.T) {
6261
g.GoCtx(func(ctx context.Context) error {
6362
prevTimeTransfer := time.Now()
6463
for {
65-
if atomic.LoadInt64(&done) > 0 {
64+
if atomic.LoadInt64(&done) > 0 || numOfTrans.Load() > 2*checkRows {
6665
return nil
6766
}
6867
if err := randomBankTransfer(numRows, maxTransfer, s.DB); err != nil {
@@ -95,7 +94,7 @@ func TestCatchupScanOrdering(t *testing.T) {
9594
t.Logf("key: %s, value: %s\n", m.Key, m.Value)
9695
t.Logf("time taken to see the %d-th changefeed change: %v", seenChanges, time.Since(prevTimeCDC))
9796
prevTimeCDC = time.Now()
98-
if seenChanges >= 200 {
97+
if seenChanges >= checkRows {
9998
atomic.StoreInt64(&done, 1)
10099
break
101100
}

pkg/roachprod/roachprod.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,11 @@ func updatePrometheusTargets(
851851
nodeIPPorts[nodeID] = []*promhelperclient.NodeInfo{
852852
{
853853
Target: fmt.Sprintf("%s:%d", nodeIP, vm.NodeExporterPort),
854-
CustomLabels: createLabels(nodeID, v, "node_exporter", false),
854+
CustomLabels: createLabels(nodeID, v, "node_exporter", true),
855855
},
856856
{
857857
Target: fmt.Sprintf("%s:%d", nodeIP, vm.EbpfExporterPort),
858-
CustomLabels: createLabels(nodeID, v, "ebpf_exporter", false),
858+
CustomLabels: createLabels(nodeID, v, "ebpf_exporter", true),
859859
},
860860
}
861861
}
@@ -877,7 +877,7 @@ func updatePrometheusTargets(
877877
nodeIPPorts[nodeID],
878878
&promhelperclient.NodeInfo{
879879
Target: fmt.Sprintf("%s:%d", nodeIP, port),
880-
CustomLabels: createLabels(nodeID, v, "workload", false),
880+
CustomLabels: createLabels(nodeID, v, "workload", true),
881881
},
882882
)
883883
}

0 commit comments

Comments
 (0)