migration

package
v0.0.0-...-f54f16c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgMigrationLockID = 77
)

Variables

This section is empty.

Functions

func RenameFromInsightsIndexName

func RenameFromInsightsIndexName(insightsIndexName, newIndexTagName string) string

RenameFromInsightsIndexName - rename from the original insights index name to the new index name This must remove extra tags from re-indexes.

Types

type Status

type Status struct {
	// contains filtered or unexported fields
}

func New

func New(client backend.Client, actionPipeline pipeline.ChefActionPipeline, postgresql *sql.DB) *Status

func (*Status) CompletedTasks

func (ms *Status) CompletedTasks() int64

CompletedTasks returns the number of tasks completed

func (*Status) Done

func (ms *Status) Done() bool

Done reports when the migration is done or it is still in progress

func (*Status) MarkUnneeded

func (ms *Status) MarkUnneeded()

MarkUnneeded marks the migrations status to done

func (*Status) MigrationNeeded

func (ms *Status) MigrationNeeded() (bool, error)

MigrationNeeded Verify if a migration is needed

func (*Status) MigrationRunning

func (ms *Status) MigrationRunning() (bool, error)

MigrationRunning - Is a migration currently running on another service. This would only be the case if this service is running in a HA frontend.

func (*Status) SendAllActionsThroughPipeline

func (ms *Status) SendAllActionsThroughPipeline() error

func (*Status) Start

func (ms *Status) Start() error

Start - start the migration from a prior automate to the current automate for only the config-mgmt-service.

We would like to use the Chain-of-responsibility pattern here but cannot because of the requirement of two stages of migration. We can not have the second stage start its migration from version 1 -> 2 after the first stage has migrated from 1 -> 2 -> ... -> n. This causes a problem because the second stage is migration from 1 -> 2 does not know what state the first stage has left the data in. For the migration framework we are always going to migrate from the current state to the current version. This does cause a maintenance problem because for each new version the old migration stages need to be updated.

func (*Status) String

func (ms *Status) String() string

String formats the migration status message

func (*Status) TotalTasks

func (ms *Status) TotalTasks() int64

TotalTasks returns the total number of tasks to process a migration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL