cockroach: Index | Files

package sqlmigrations

import ""


Package Files



var SettingsDefaultOverrides = map[string]string{
    "diagnostics.reporting.enabled": "true",
    "cluster.secret":                "<random>",

SettingsDefaultOverrides documents the effect of several migrations that add an explicit value for a setting, effectively changing the "default value" from what was defined in code.

func ExpectedDescriptorIDs Uses

func ExpectedDescriptorIDs(
    ctx context.Context,
    db db,
    defaultZoneConfig *config.ZoneConfig,
    defaultSystemZoneConfig *config.ZoneConfig,
) (sqlbase.IDs, error)

ExpectedDescriptorIDs returns the list of all expected system descriptor IDs, including those added by completed migrations. This is needed for certain tests, which check the number of ranges and system tables at node startup.

NOTE: This value may be out-of-date if another node is actively running migrations, and so should only be used in test code where the migration lifecycle is tightly controlled.

type Manager Uses

type Manager struct {
    // contains filtered or unexported fields

Manager encapsulates the necessary functionality for handling migrations of data in the cluster.

func NewManager Uses

func NewManager(
    stopper *stop.Stopper,
    db *client.DB,
    executor *sql.InternalExecutor,
    clock *hlc.Clock,
    testingKnobs MigrationManagerTestingKnobs,
    clientID string,
) *Manager

NewManager initializes and returns a new Manager object.

func (*Manager) EnsureMigrations Uses

func (m *Manager) EnsureMigrations(ctx context.Context, bootstrapVersion roachpb.Version) error

EnsureMigrations should be run during node startup to ensure that all required migrations have been run (and running all those that are definitely safe to run).

type MigrationManagerTestingKnobs Uses

type MigrationManagerTestingKnobs struct {
    // DisableBackfillMigrations stops applying migrations once
    // a migration with 'doesBackfill == true' is encountered.
    // TODO(mberhault): we could skip only backfill migrations and dependencies
    // if we had some concept of migration dependencies.
    DisableBackfillMigrations bool

MigrationManagerTestingKnobs contains testing knobs.

func (*MigrationManagerTestingKnobs) ModuleTestingKnobs Uses

func (*MigrationManagerTestingKnobs) ModuleTestingKnobs()

ModuleTestingKnobs is part of the base.ModuleTestingKnobs interface.

Package sqlmigrations imports 23 packages (graph) and is imported by 9 packages. Updated 2019-11-18. Refresh now. Tools for package owners.