Skip to content

Commit 306bfe6

Browse files
jtlisigouthamve
andcommitted
wrap migration commands (#1980)
* wrap migration commands Signed-off-by: Jacob Lisi <[email protected]> * update changelog Signed-off-by: Jacob Lisi <[email protected]> * fix missing semicolon Signed-off-by: Jacob Lisi <[email protected]> * Fix typo to make lint pass. Signed-off-by: Goutham Veeramachaneni <[email protected]> Co-authored-by: Goutham Veeramachaneni <[email protected]>
1 parent 8b16675 commit 306bfe6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* [FEATURE] EXPERIMENTAL: Added `/series` API endpoint support with TSDB blocks storage. #1830
2424
* [FEATURE] Added "multi" KV store that can interact with two other KV stores, primary one for all reads and writes, and secondary one, which only receives writes. Primary/secondary store can be modified in runtime via runtime-config mechanism (previously "overrides"). #1749
2525
* [ENHANCEMENT] Added `password` and `enable_tls` options to redis cache configuration. Enables usage of Microsoft Azure Cache for Redis service.
26+
* [BUGFIX] Wrapped migration in BEGIN and COMMIT #1980
2627
* [BUGFIX] Fixed unnecessary CAS operations done by the HA tracker when the jitter is enabled. #1861
2728
* [BUGFIX] Fixed #1904 ingesters getting stuck in a LEAVING state after coming up from an ungraceful exit. #1921
2829
* [BUGFIX] Reduce memory usage when ingester Push() errors. #1922

cmd/cortex/migrations/002_immutable_configs.up.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
-- process (as exemplified in users/db/migrations/006 to 010), but currently
33
-- there are no data in production and only one row in dev.
44

5+
-- https://github.com/mattes/migrate/tree/master/database/postgres#upgrading-from-v1
6+
-- Wrap all commands in BEGIN and COMMIT to accommodate upgrade
7+
BEGIN;
8+
59
-- The existing id, type columns are the id & type of the entity that owns the
610
-- config.
711
ALTER TABLE configs RENAME COLUMN id TO owner_id;
@@ -12,3 +16,5 @@ ALTER TABLE configs ADD COLUMN id SERIAL;
1216

1317
ALTER TABLE configs DROP CONSTRAINT configs_pkey;
1418
ALTER TABLE configs ADD PRIMARY KEY (id, owner_id, owner_type, subsystem);
19+
20+
COMMIT;

0 commit comments

Comments
 (0)