Skip to content

Commit 9961f05

Browse files
craig[bot]stevendannaRaduBerindedt
committed
154939: stress: rename Stress to DevStress r=herkolategan,jeffswenson a=stevendanna This renames the current implementation of Stress to DevStress and then adds a new Stress function that covers both local and nightly stress runs. Epic: none Release note: None 155220: sidetransport: remove a call to timeutil.Now() r=stevendanna a=stevendanna This removes an extra call to timeutil.Now(). Just something I noticed when reading the code. timeutil.Unit() should be able to use the monotonic clock if `by` has a monotonic clock reading already which is also nice. It might be nice to make a version of the pacer that can use crtime.Mono but that is a larger change. Epic: none Release note: None 155739: storage: add storage.tombstone_dense_compaction_threshold setting r=RaduBerinde a=RaduBerinde Add a cluster setting to control the tombstone-dense compaction threshold. Fixes: #155715 Release note: None 155785: gssapi: add shim for old __res_nsearch version r=dt a=dt Release note: none. Epic: none. Co-authored-by: Steven Danna <danna@cockroachlabs.com> Co-authored-by: Radu Berinde <radu@cockroachlabs.com> Co-authored-by: David Taylor <davidt@davidt.io>
5 parents 1656a4c + 25f114c + 14a814b + 5e4f9c2 + f7822ee commit 9961f05

File tree

11 files changed

+68
-23
lines changed

11 files changed

+68
-23
lines changed

build/bazelutil/cc/BUILD.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cc_library(
2+
name = "resolver_compat",
3+
srcs = ["res_compat.c"],
4+
visibility = ["//visibility:public"],
5+
alwayslink = True,
6+
)
7+
8+
cc_library(
9+
name = "resolver_libs",
10+
linkopts = [
11+
"-Wl,--push-state,--no-as-needed",
12+
"-lresolv",
13+
"-Wl,--pop-state",
14+
],
15+
visibility = ["//visibility:public"],
16+
)

build/bazelutil/cc/res_compat.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// res_compat.c
2+
#include <resolv.h>
3+
4+
// Provide a weak __res_nsearch for old krb5 objects.
5+
// Forward to the public res_nsearch symbol on modern glibc.
6+
__attribute__((weak))
7+
int __res_nsearch(res_state statp,
8+
const char *dname,
9+
int class,
10+
int type,
11+
unsigned char *answer,
12+
int anslen) {
13+
return res_nsearch(statp, dname, class, type, answer, anslen);
14+
}

pkg/backup/restore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestRestoreRetryFastFails(t *testing.T) {
107107
// runtime does not exceed the max duration of the retry policy, or
108108
// else very few attempts will be made.
109109
maxDuration := 500 * time.Millisecond
110-
if skip.Stress() {
110+
if skip.DevStress() {
111111
// Under stress, the restore will take longer to complete, so we need to
112112
// increase max duration accordingly.
113113
maxDuration = 1500 * time.Millisecond

pkg/ccl/gssapiccl/BUILD.bazel

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ go_library(
1111
"//conditions:default": ["empty.go"],
1212
}),
1313
cdeps = select({
14-
"@io_bazel_rules_go//go/platform:linux": ["//c-deps:libkrb5"],
14+
"@io_bazel_rules_go//go/platform:linux": [
15+
"//c-deps:libkrb5", "//build/bazelutil/cc:resolver_compat","//build/bazelutil/cc:resolver_libs",
16+
],
1517
"//conditions:default": [],
1618
}),
1719
cgo = True,
18-
clinkopts = select({
19-
# NB: On Ubuntu, res_nsearch is found in the resolv_wrapper library,
20-
# found in the libresolv-wrapper package.
21-
"//build/toolchains:is_dev_linux": ["-ldl -lresolv -lresolv_wrapper"],
22-
"@io_bazel_rules_go//go/platform:linux": ["-ldl -lresolv"],
23-
"//conditions:default": [],
24-
}),
2520
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/gssapiccl",
2621
visibility = ["//visibility:public"],
2722
deps = select({

pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl/local_test_util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func runTest(t *testing.T, variant sharedtestutil.TestVariant, test sharedtestut
107107
// extend the TTL by 10x to handle cases where the system is too
108108
// overloaded to heartbeat at sub-second intervals.
109109
ttlOverride := 250 * time.Millisecond
110-
if skip.Stress() {
110+
if skip.DevStress() {
111111
ttlOverride *= 10
112112
}
113113
heartbeatOverride := ttlOverride / 10

pkg/crosscluster/replicationtestutils/testutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ func (c *TenantStreamingClusters) SrcExec(exec srcInitExecFunc) {
582582

583583
func WaitUntilStartTimeReached(t *testing.T, db *sqlutils.SQLRunner, ingestionJobID jobspb.JobID) {
584584
timeout := 45 * time.Second
585-
if skip.Stress() || util.RaceEnabled {
585+
if skip.DevStress() || util.RaceEnabled {
586586
timeout *= 5
587587
}
588588
testutils.SucceedsWithin(t, func() error {

pkg/kv/kvserver/closedts/sidetransport/sender.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,10 @@ func (b *updatesBuf) PaceBroadcastUpdate(ctx context.Context, condVar *sync.Cond
697697
}
698698
b.mu.Unlock()
699699

700-
if workLeft > 0 && timeutil.Now().Before(by) {
701-
time.Sleep(by.Sub(timeutil.Now()))
700+
if workLeft > 0 {
701+
if wait := timeutil.Until(by); wait > 0 {
702+
time.Sleep(wait)
703+
}
702704
}
703705
}
704706
}

pkg/sql/mvcc_statistics_update_job_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func TestTenantGlobalAggregatedLivebytes(t *testing.T) {
203203
// Exact match for non stress tests, and allow values to differ by up to
204204
// 5% in stress situations.
205205
confidenceLevel := 0.0
206-
if skip.Stress() {
206+
if skip.DevStress() {
207207
confidenceLevel = 0.05
208208
}
209209
testutils.SucceedsSoon(t, func() error {

pkg/storage/pebble.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ var baselineDeletionRate = settings.RegisterIntSetting(
524524
settings.NonNegativeInt,
525525
)
526526

527+
var tombstoneDenseCompactionThreshold = settings.RegisterIntSetting(
528+
settings.ApplicationLevel,
529+
"storage.tombstone_dense_compaction_threshold",
530+
"percentage of tombstone-dense data blocks that trigger a compaction (0 = disabled)",
531+
10, // 10%
532+
settings.IntInRange(0, 100),
533+
)
534+
527535
// EngineComparer is a pebble.Comparer object that implements MVCC-specific
528536
// comparator settings for use with Pebble.
529537
var EngineComparer = func() pebble.Comparer {
@@ -962,6 +970,9 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
962970
cfg.opts.TargetByteDeletionRate = func() int {
963971
return int(baselineDeletionRate.Get(&cfg.settings.SV))
964972
}
973+
cfg.opts.Experimental.TombstoneDenseCompactionThreshold = func() float64 {
974+
return 0.01 * float64(tombstoneDenseCompactionThreshold.Get(&cfg.settings.SV))
975+
}
965976
if cfg.opts.Experimental.UseDeprecatedCompensatedScore == nil {
966977
cfg.opts.Experimental.UseDeprecatedCompensatedScore = func() bool {
967978
return useDeprecatedCompensatedScore.Get(&cfg.settings.SV)

pkg/testutils/skip/skip.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ func UnderDuressWithIssue(t SkippableTest, githubIssueID int, args ...interface{
188188
}
189189
}
190190

191-
// Duress catures the conditions that currently lead us to
192-
// believe that tests may be slower than normal.
191+
// Duress captures the conditions that currently lead us to believe that tests
192+
// may be slower than normal.
193193
func Duress() bool {
194194
return util.RaceEnabled || Stress() || syncutil.DeadlockEnabled
195195
}

0 commit comments

Comments
 (0)