Skip to content

Commit c9554bb

Browse files
committed
*: address a couple of nits
We can use `settings.Fraction` for non-negative float with max 1.0. Also fix up one comment. (Noticed this while reviewing the probabilistic transaction tracing backport.) Release note: None
1 parent 448eea6 commit c9554bb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

pkg/crosscluster/settings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var ReplanThreshold = settings.RegisterFloatSetting(
5959
"fraction of nodes in the producer or consumer job that would need to change to refresh the"+
6060
" physical execution plan. If set to 0, the physical plan will not automatically refresh.",
6161
0.1,
62-
settings.NonNegativeFloatWithMaximum(1),
62+
settings.Fraction,
6363
settings.WithName("physical_replication.consumer.replan_flow_threshold"),
6464
)
6565

@@ -116,7 +116,7 @@ var LogicalReplanThreshold = settings.RegisterFloatSetting(
116116
"fraction of nodes in the producer or consumer job that would need to change to refresh the"+
117117
" physical execution plan. If set to 0, the physical plan will not automatically refresh.",
118118
0.1,
119-
settings.NonNegativeFloatWithMaximum(1),
119+
settings.Fraction,
120120
)
121121

122122
var LogicalReplanFrequency = settings.RegisterDurationSetting(

pkg/sql/exec_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ var TraceTxnSampleRate = settings.RegisterFloatSetting(
295295
"will have tracing enabled, and only those which exceed the configured "+
296296
"threshold will be logged.",
297297
1.0,
298-
settings.NonNegativeFloatWithMaximum(1.0),
298+
settings.Fraction,
299299
settings.WithPublic)
300300

301301
// TraceTxnOutputJaegerJSON sets the output format of transaction trace logs.

pkg/sql/stats/histogram.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var MaxFractionHistogramMCVs = settings.RegisterFloatSetting(
6363
"sql.stats.histogram_buckets.max_fraction_most_common_values",
6464
"maximum fraction of histogram buckets to use for most common values",
6565
0.1,
66-
settings.NonNegativeFloatWithMaximum(1),
66+
settings.Fraction,
6767
settings.WithPublic)
6868

6969
// HistogramVersion identifies histogram versions.

pkg/util/log/logtestutils/log_spy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (s *LogSpy) Reset() {
8686
s.mu.logs = []logpb.Entry{}
8787
}
8888

89-
// ReadAll consumes the specified number of logs contained within
89+
// Read consumes the specified number of logs contained within
9090
// the spy and returns them as a list. Once the logs are consumed
9191
// they cannot be read again.
9292
func (s *LogSpy) Read(n int) []logpb.Entry {

0 commit comments

Comments
 (0)