Skip to content

Commit 1c2c92b

Browse files
craig[bot]pav-kvyuzefovichmsbutlerprafull01
committed
147930: clusterversion: rm V25_1_MoveRaftTruncatedState r=RaduBerinde,arulajmani a=pav-kv Part of #97613 147942: sql/export: extract EXPORT files from sql/importer r=yuzefovich a=yuzefovich There is no point in keeping EXPORT-related files in the same package as IMPORT-related ones. This is beneficial also due to different owners. The only downside is that backports for EXPORT changes won't be clean for a couple of releases. I copied using "large" pool for "heavy" test configs (i.e. duress). Epic: None Release note: None 147946: sql: remove miscellaneous unused functions and objects r=yuzefovich a=yuzefovich These were exported, so our unused linter didn't catch them. Epic: None Release note: None 147989: crosscluster/logical: wipe status on clean pause r=jeffswenson a=msbutler If the user pauses the LDR job, the status may be stale, like "catching up on 110 out of 230 ranges" Epic: none Release note: none 148002: Use make target to bump version in helm chart r=rail a=prafull01 Fixes: cockroachdb/helm-charts#525 Epic: none Co-authored-by: Pavel Kalinnikov <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Michael Butler <[email protected]> Co-authored-by: prafull01 <[email protected]>
6 parents 83345c9 + 5643769 + 341d399 + 2624613 + 386cbf1 + fea8522 commit 1c2c92b

File tree

39 files changed

+168
-357
lines changed

39 files changed

+168
-357
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
#!/pkg/sql/BUILD.bazel @cockroachdb/sql-queries-noreview
7878

7979
/pkg/sql/importer/ @cockroachdb/sql-queries-prs
80-
/pkg/sql/importer/export* @cockroachdb/cdc-prs
8180
/pkg/ccl/importerccl/ @cockroachdb/sql-queries-prs
8281

8382
/pkg/sql/appstatspb @cockroachdb/obs-prs
@@ -261,6 +260,7 @@
261260

262261
/pkg/ccl/jobsccl/ @cockroachdb/jobs-prs @cockroachdb/disaster-recovery
263262
/pkg/ccl/changefeedccl/ @cockroachdb/cdc-prs
263+
/pkg/sql/export/ @cockroachdb/cdc-prs
264264

265265
/pkg/crosscluster/ @cockroachdb/disaster-recovery
266266
/pkg/backup/ @cockroachdb/disaster-recovery

pkg/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ ALL_TESTS = [
482482
"//pkg/sql/execinfrapb:execinfrapb_test",
483483
"//pkg/sql/execstats:execstats_disallowed_imports_test",
484484
"//pkg/sql/execstats:execstats_test",
485+
"//pkg/sql/export:export_test",
485486
"//pkg/sql/exprutil:exprutil_test",
486487
"//pkg/sql/flowinfra:flowinfra_disallowed_imports_test",
487488
"//pkg/sql/flowinfra:flowinfra_test",
@@ -1988,6 +1989,8 @@ GO_TARGETS = [
19881989
"//pkg/sql/execstats:execstats",
19891990
"//pkg/sql/execstats:execstats_test",
19901991
"//pkg/sql/execversion:execversion",
1992+
"//pkg/sql/export:export",
1993+
"//pkg/sql/export:export_test",
19911994
"//pkg/sql/exprutil:evalexpr",
19921995
"//pkg/sql/exprutil:exprutil",
19931996
"//pkg/sql/exprutil:exprutil_test",

pkg/clusterversion/cockroach_versions.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ const (
190190
// TODO_Delete_V25_1_AddJobsTables added new jobs tables.
191191
TODO_Delete_V25_1_AddJobsTables
192192

193-
// TODO_Delete_V25_1_MoveRaftTruncatedState moves the RaftTruncatedState in eval result
194-
// from ReplicaState to its own field.
195-
TODO_Delete_V25_1_MoveRaftTruncatedState
196-
197193
// TODO_Delete_V25_1_AddRangeForceFlushKey adds the RangeForceFlushKey, a replicated
198194
// range-ID local key, which is written below raft.
199195
TODO_Delete_V25_1_AddRangeForceFlushKey
@@ -276,7 +272,6 @@ var versionTable = [numKeys]roachpb.Version{
276272
TODO_Delete_V25_1_Start: {Major: 24, Minor: 3, Internal: 2},
277273

278274
TODO_Delete_V25_1_AddJobsTables: {Major: 24, Minor: 3, Internal: 4},
279-
TODO_Delete_V25_1_MoveRaftTruncatedState: {Major: 24, Minor: 3, Internal: 6},
280275
TODO_Delete_V25_1_AddRangeForceFlushKey: {Major: 24, Minor: 3, Internal: 8},
281276
TODO_Delete_V25_1_BatchStreamRPC: {Major: 24, Minor: 3, Internal: 10},
282277
TODO_Delete_V25_1_PreparedTransactionsTable: {Major: 24, Minor: 3, Internal: 12},

pkg/cmd/release/update_helm.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ import (
1313

1414
// updateHelm runs commands in the helm-charts repo in order to update the cockroachdb version.
1515
func updateHelm(workDir string, version string) error {
16-
commands := []*exec.Cmd{
17-
exec.Command("bazel", "build", "//build"),
18-
// Helm charts use the version without the "v" prefix, but the bumper trims it if present.
19-
exec.Command("sh", "-c", fmt.Sprintf("$(bazel info bazel-bin)/build/build_/build bump %s", version)),
20-
}
21-
for _, cmd := range commands {
22-
cmd.Dir = workDir
23-
out, err := cmd.CombinedOutput()
24-
if err != nil {
25-
return fmt.Errorf("failed running '%s' with message '%s': %w", cmd.String(), string(out), err)
26-
}
27-
log.Printf("ran '%s': %s\n", cmd.String(), string(out))
16+
// Helm charts use the version without the "v" prefix, but the bumper trims it if present.
17+
cmd := exec.Command("sh", "-c", fmt.Sprintf("make bump/%s", version))
18+
cmd.Dir = workDir
19+
out, err := cmd.CombinedOutput()
20+
if err != nil {
21+
return fmt.Errorf("failed running '%s' with message '%s': %w", cmd.String(), string(out), err)
2822
}
23+
log.Printf("ran '%s': %s\n", cmd.String(), string(out))
24+
2925
return nil
3026
}

pkg/crosscluster/logical/logical_replication_job.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func (r *logicalReplicationResumer) handleResumeError(
9898
ctx context.Context, execCtx sql.JobExecContext, err error,
9999
) error {
100100
if err == nil {
101+
r.updateStatusMessage(ctx, "")
101102
return nil
102103
}
103104
if jobs.IsPermanentJobError(err) {

pkg/kv/kvserver/batcheval/cmd_truncate_log.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"context"
1010
"time"
1111

12-
"github.com/cockroachdb/cockroach/pkg/clusterversion"
1312
"github.com/cockroachdb/cockroach/pkg/keys"
1413
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
1514
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval/result"
@@ -125,16 +124,11 @@ func TruncateLog(
125124
}
126125
ms.SysBytes = -ms.SysBytes // simulate the deletion
127126

128-
tState := &kvserverpb.RaftTruncatedState{
127+
var pd result.Result
128+
pd.Replicated.SetRaftTruncatedState(&kvserverpb.RaftTruncatedState{
129129
Index: args.Index - 1,
130130
Term: term,
131-
}
132-
133-
var pd result.Result
134-
pd.Replicated.SetRaftTruncatedState(tState,
135-
cArgs.EvalCtx.ClusterSettings().Version.IsActive(
136-
ctx, clusterversion.TODO_Delete_V25_1_MoveRaftTruncatedState),
137-
)
131+
})
138132
pd.Replicated.RaftLogDelta = ms.SysBytes
139133
pd.Replicated.RaftExpectedFirstIndex = firstIndex
140134
return pd, nil

pkg/kv/kvserver/kvserverpb/proposer_kv.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,17 @@ func (r *ReplicatedEvalResult) IsTrivial() bool {
8181
}
8282

8383
// SetRaftTruncatedState puts the given RaftTruncatedState into this evaluation
84-
// result. Since v25.1, it uses r.RaftTruncatedState field, and falls back to
85-
// r.State.TruncatedState for backwards compatibility in mixed-version clusters.
86-
//
87-
// TODO(#97613): use r.RaftTruncatedState unconditionally when the ReplicaState
88-
// field is removed.
89-
func (r *ReplicatedEvalResult) SetRaftTruncatedState(ts *RaftTruncatedState, v25dot1 bool) {
90-
if v25dot1 {
91-
r.RaftTruncatedState = ts
92-
} else if r.State != nil {
93-
r.State.TruncatedState = ts
94-
} else {
95-
r.State = &ReplicaState{TruncatedState: ts}
96-
}
84+
// result.
85+
func (r *ReplicatedEvalResult) SetRaftTruncatedState(ts *RaftTruncatedState) {
86+
r.RaftTruncatedState = ts
9787
}
9888

9989
// GetRaftTruncatedState returns the RaftTruncatedState present in this
10090
// evaluation result. Since v25.1, it can be present in one of the two places.
101-
// See SetRaftTruncatedState.
91+
//
92+
// TODO(#97613): use r.RaftTruncatedState unconditionally when the truncated
93+
// state field in ReplicaState is removed and can't be set. Currently,
94+
// historical proposals can still have it.
10295
func (r *ReplicatedEvalResult) GetRaftTruncatedState() *RaftTruncatedState {
10396
if ts := r.RaftTruncatedState; ts != nil {
10497
return ts

pkg/kv/kvserver/replica_application_state_machine_test.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func TestReplicaStateMachineRaftLogTruncationStronglyCoupled(t *testing.T) {
159159
defer leaktest.AfterTest(t)()
160160
defer log.Scope(t).Close(t)
161161

162-
runTest := func(t *testing.T, accurate, v25dot1 bool) {
162+
runTest := func(t *testing.T, accurate bool) {
163163
tc := testContext{}
164164
ctx := context.Background()
165165
stopper := stop.NewStopper()
@@ -201,7 +201,7 @@ func TestReplicaStateMachineRaftLogTruncationStronglyCoupled(t *testing.T) {
201201
}
202202
evalResult.SetRaftTruncatedState(&kvserverpb.RaftTruncatedState{
203203
Index: truncatedIndex + 1,
204-
}, v25dot1)
204+
})
205205

206206
ent := &raftlog.Entry{
207207
Entry: raftpb.Entry{
@@ -258,17 +258,15 @@ func TestReplicaStateMachineRaftLogTruncationStronglyCoupled(t *testing.T) {
258258
}
259259

260260
testutils.RunTrueAndFalse(t, "accurate first index", func(t *testing.T, accurate bool) {
261-
testutils.RunTrueAndFalse(t, "v25.1", func(t *testing.T, v25dot1 bool) {
262-
runTest(t, accurate, v25dot1)
263-
})
261+
runTest(t, accurate)
264262
})
265263
}
266264

267265
func TestReplicaStateMachineRaftLogTruncationLooselyCoupled(t *testing.T) {
268266
defer leaktest.AfterTest(t)()
269267
defer log.Scope(t).Close(t)
270268

271-
runTest := func(t *testing.T, accurate, v25dot1 bool) {
269+
runTest := func(t *testing.T, accurate bool) {
272270
tc := testContext{}
273271
ctx := context.Background()
274272
stopper := stop.NewStopper()
@@ -329,7 +327,7 @@ func TestReplicaStateMachineRaftLogTruncationLooselyCoupled(t *testing.T) {
329327
}
330328
evalResult.SetRaftTruncatedState(&kvserverpb.RaftTruncatedState{
331329
Index: truncatedIndex + 1,
332-
}, v25dot1)
330+
})
333331
ent := &raftlog.Entry{
334332
Entry: raftpb.Entry{
335333
Index: uint64(raftAppliedIndex + 1),
@@ -406,9 +404,7 @@ func TestReplicaStateMachineRaftLogTruncationLooselyCoupled(t *testing.T) {
406404
}
407405

408406
testutils.RunTrueAndFalse(t, "accurate first index", func(t *testing.T, accurate bool) {
409-
testutils.RunTrueAndFalse(t, "v25.1", func(t *testing.T, v25dot1 bool) {
410-
runTest(t, accurate, v25dot1)
411-
})
407+
runTest(t, accurate)
412408
})
413409
}
414410

pkg/settings/registry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ var retiredSettings = map[InternalKey]struct{}{
267267
"changefeed.new_pubsub_sink_enabled": {},
268268
"changefeed.new_pubsub_sink.enabled": {},
269269
"logical_replication.consumer.use_implicit_txns.enabled": {},
270+
271+
// removed as of 25.3
272+
"sql.metrics.max_stmt_fingerprints_per_explicit_txn": {},
270273
}
271274

272275
// grandfatheredDefaultSettings is the list of "grandfathered" existing sql.defaults

pkg/sql/catalog/post_deserialization_changes.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ const (
7979
// field was unset and that the MVCC timestamp value was assigned to it.
8080
SetModTimeToMVCCTimestamp
8181

82-
// SetCreateAsOfTimeUsingModTime indicates that a table's CreateAsOfTime field
83-
// was unset and the ModificationTime value was assigned to it.
84-
SetCreateAsOfTimeUsingModTime
85-
8682
// SetSystemDatabaseDescriptorVersion indicates that the system database
8783
// descriptor did not have its version set.
8884
SetSystemDatabaseDescriptorVersion

0 commit comments

Comments
 (0)