Skip to content

Commit

Permalink
migrations: remove unused testing knobs
Browse files Browse the repository at this point in the history
These testing knobs are currently unused.

Release note: None
  • Loading branch information
stevendanna committed Feb 8, 2022
1 parent a7b1c17 commit dd46105
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion pkg/migration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ go_library(
"//pkg/base",
"//pkg/clusterversion",
"//pkg/jobs",
"//pkg/jobs/jobspb",
"//pkg/keys",
"//pkg/kv",
"//pkg/kv/kvclient/kvcoord",
Expand Down
9 changes: 0 additions & 9 deletions pkg/migration/migrations/schema_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"strings"

"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
"github.com/cockroachdb/cockroach/pkg/kv"
"github.com/cockroachdb/cockroach/pkg/migration"
"github.com/cockroachdb/cockroach/pkg/security"
Expand Down Expand Up @@ -92,11 +91,6 @@ func migrateTable(
if mutations := storedTable.GetMutationJobs(); len(mutations) > 0 {
for _, mutation := range mutations {
log.Infof(ctx, "waiting for the mutation job %v to complete", mutation.JobID)
// TODO(cameron): Remove this knob conditional once the related migration code has been removed.
// See pkg/migration/testing_knobs.go for more details.
if d.TestingKnobs.BeforeWaitInRetryJobsWithExponentialBackoffMigration != nil {
d.TestingKnobs.BeforeWaitInRetryJobsWithExponentialBackoffMigration(jobspb.JobID(mutation.JobID))
}
if _, err := d.InternalExecutor.Exec(ctx, "migration-mutations-wait",
nil, "SHOW JOB WHEN COMPLETE $1", mutation.JobID); err != nil {
return err
Expand All @@ -122,9 +116,6 @@ func migrateTable(
}
if exists {
log.Infof(ctx, "skipping %s operation as the schema change already exists.", op.name)
if d.TestingKnobs != nil && d.TestingKnobs.SkippedMutation != nil {
d.TestingKnobs.SkippedMutation()
}
return nil
}

Expand Down
18 changes: 0 additions & 18 deletions pkg/migration/testing_knobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package migration
import (
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
)

// TestingKnobs are knobs to inject behavior into the migration manager which
Expand All @@ -27,23 +26,6 @@ type TestingKnobs struct {

// RegistryOverride is used to inject migrations for specific cluster versions.
RegistryOverride func(cv clusterversion.ClusterVersion) (Migration, bool)

// BeforeWaitInRetryJobsWithExponentialBackoffMigration is called before
// waiting for a mutation job to complete in retryJobsWithExponentialBackoff
// migration.
// TODO(sajjad): Remove this knob when the related migration code is removed.
// This knob is used only in exponential backoff migration and related tests. See
// pkg/migration/retry_jobs_with_exponential_backoff.go and
// pkg/migration/retry_jobs_with_exponential_backoff_external_test.go
BeforeWaitInRetryJobsWithExponentialBackoffMigration func(jobspb.JobID)

// SkippedMutation is called if a mutation job is skipped as part of the
// retryJobsWithExponentialBackoff migration.
// TODO(sajjad): Remove this knob when the related migration code is removed.
// This knob is used only in exponential backoff migration and related tests. See
// pkg/migration/retry_jobs_with_exponential_backoff.go and
// pkg/migration/retry_jobs_with_exponential_backoff_external_test.go
SkippedMutation func()
}

// ModuleTestingKnobs makes TestingKnobs a base.ModuleTestingKnobs.
Expand Down

0 comments on commit dd46105

Please sign in to comment.