Repository navigation
Combine PostgreSQL Visibility schema upgrades from v1.10 through v1.13 - #10371
Conversation
| CREATE INDEX IF NOT EXISTS by_temporal_reported_problems ON executions_visibility USING GIN (namespace_id, TemporalReportedProblems jsonb_path_ops); | ||
|
|
||
| -- v1.11 | ||
| -- Indexes for the pre-allocated CHASM search attributes |
There was a problem hiding this comment.
can we remove some of them and add back at a later release? I think only small number of them are actually used.
There was a problem hiding this comment.
I'm ok either way, but it's kind of weird to have these in another version. It might seem out of sync with other SQL DBs schemas.
| "MinCompatibleVersion": "0.1", | ||
| "Description": "add TemporalReportedProblems column", | ||
| "SchemaUpdateCqlFiles": [ | ||
| "add_temporal_reported_columns.sql" |
There was a problem hiding this comment.
shall we remove those sql files as well?
There was a problem hiding this comment.
I was thinking of leaving just for the record, but I'm fine with removing as well. No strong feelings.
|
|
||
|
|
||
| -- v1.10 | ||
| CREATE INDEX IF NOT EXISTS by_temporal_reported_problems ON executions_visibility USING GIN (namespace_id, TemporalReportedProblems jsonb_path_ops); |
There was a problem hiding this comment.
do we need to use CONCURRENTLY to avoid locking the entire table? but hmm I think handling failed index creation will be tricky...
There was a problem hiding this comment.
I wonder if it is still better to do this, given we can have many indices, especially for CHASM search attributes? But, doing this logic in the script might make it hard to read.
There was a problem hiding this comment.
Added CONCURRENTLY to CREATE INDEX.
Also added logic to drop invalid indices, ie., if CREATE INDEX fails, they can re-run the file: it will drop the invalid index first, and then try to create it again.
81dd960 to
56a530a
Compare
56a530a to
237dff7
Compare
… through v1.13 (#10371) (#10556) Backport of #10371 to release/v1.31.x for the v1.31.1 patch. Co-authored-by: Rodrigo Zhou <[email protected]>
… through v1.13 (#10371) (#10681) Cherry-picks #10371 to release/v1.30.x for v1.30.5. Co-authored-by: Rodrigo Zhou <[email protected]>
#10371) ## What changed? Combine PostgreSQL Visibility schema upgrades from v1.10 through v1.13 ## Why? Adding one column at a time requires scanning the entire table. So, combining all the schema changes in v1.30.0 release into a single SQL upgrade file. #10358 ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks
## What changed? Apply same optimizations in #10371 for v1.14. ## Why? Better upgrade script. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks
* Align the server upgrade guide with current upgrade guidance Corrects three claims in the upgrade guide against the server-operations upgrade playbook: - Skipping a minor version isn't blocked by unreadable data formats. The server doesn't enforce the path; stepping one minor at a time avoids skipping version-gated startup work, and it's the tested path. - Always run the schema update before rolling out the binary, rather than checking release notes for whether one is needed. One run applies every intermediate schema version. - Replace the fixed 10-minute wait per version with the metrics to watch. Adds the release-notes override, the PostgreSQL v1.30/v1.31 Visibility table rebuild (fixed in v1.30.5, v1.31.1, and v1.31.3 by temporalio/temporal#10371 and #11599), the startup schema check, service order, rollback, and passive-first upgrades with Multi-Cluster Replication, plus a pointer from the Multi-Cluster Replication page. * Record the upgrade guide alignment in the Kapa decision log * Use counter rates for upgrade checks and scope passive-first upgrades Four of the verification metrics are counters, so the near-zero targets apply to their recent rate. Passive-first ordering only holds when one Temporal Service is active for every Global Namespace.
What changed?
Combine PostgreSQL Visibility schema upgrades from v1.10 through v1.13
Why?
Adding one column at a time requires scanning the entire table. So, combining all the schema changes in v1.30.0 release into a single SQL upgrade file.
#10358
How did you test it?
Potential risks