Documentation ¶
Overview ¶
Package expectedschema contains the schema the database is expected to have.
This file contains useful logic for maintenance tasks to migrate new schema changes.
Maintenance tasks (see //perf/go/maintenance/maintenance.go) use the same executable as the perf frontend and ingesters, so when Louhi does an update all of them will be deployed at the same time. Since frontend and ingesters check for a correct schema they will panic on startup, so the old instances of those apps will continue to run.
The maintenance task will run and thus will upgrade the schema in the database. After that completes when frontend and ingesters are retried (k8s does that automatically), then they will start successfully. This means that any change in schema must be compatible with both the current and previous version of the perfserver executable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FS embed.FS
FS is a filesystem with the schema.json file.
var FromLiveToNext = `` /* 266-byte string literal not displayed */
The two vars below should be updated everytime there's a schema change:
- FromLiveToNext tells the SQL to execute to apply the change
- FromNextToLive tells the SQL to revert the change
Also we need to update LiveSchema schema and DropTables in sql_test.go:
- DropTables deletes all tables *including* the new one in the change.
- LiveSchema creates all existing tables *without* the new one in the change.
DO NOT DROP TABLES IN VAR BELOW. FOR MODIFYING COLUMNS USE ADD/DROP COLUMN INSTEAD.
var FromNextToLive = `` /* 252-byte string literal not displayed */
ONLY DROP TABLE IF YOU JUST CREATED A NEW TABLE. FOR MODIFYING COLUMNS USE ADD/DROP COLUMN INSTEAD.
Functions ¶
func Load ¶
func Load() (schema.Description, error)
Load returns the deserialized schema.Description stored in the schema.json file.
func LoadPrev ¶
func LoadPrev() (schema.Description, error)
LoadPrev returns the deserialized schema.Description stored in the schema_old.json file.
Types ¶
This section is empty.