You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "MonkeyCanCode (via GitHub)" <gi...@apache.org> on 2026/09/03 07:45:03 UTC
[PR] Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
MonkeyCanCode opened a new pull request, #5437:
URL: https://github.com/apache/polaris/pull/5437
<!--
๐ Describe what changes you're proposing, especially breaking or user-facing changes.
๐ See https://github.com/apache/polaris/blob/main/CONTRIBUTING.md for more.
-->
Follow up on https://github.com/apache/polaris/pull/5349 where the current SQL instructions missed the drop for table idempotency_records and its indices.
## Checklist
- [ ] ๐ก๏ธ Don't disclose security issues! (contact security@apache.org)
- [ ] ๐ Clearly explained why the changes are needed, or linked related issues: Fixes #
- [ ] ๐งช Added/updated tests with good coverage, or manually tested (and explained how)
- [ ] ๐ก Added comments for complex logic
- [ ] ๐งพ Updated `CHANGELOG.md` (if needed)
- [ ] ๐ Updated documentation in `site/content/in-dev/unreleased` (if needed)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4007410548
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
Review Comment:
This statement errors on a v3 database. `idempotency_records` was added in v4, but the paragraph right above says the block is for "an existing v3/v4 database" โ so a v3 operator pastes this and hits an error. If they're running it as one transaction or with psql's `ON_ERROR_STOP`, the `events` fix and the version bump never run either.
Second problem: `idempotency_records_pkey` is Postgres's generated name for an unnamed primary key. v4 declares it inline as `PRIMARY KEY (realm_id, idempotency_key)`, so nothing guarantees that name on H2, which the same paragraph lists as supported.
Both go away if you just delete this line โ `DROP TABLE` below drops the primary key too. Can we cut it (and the `DROP INDEX` above) and keep only the `DROP TABLE`?
<sub>๐ค AI-generated review comment โ agents make mistakes, so please verify before acting on it.</sub>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3940536132
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
Is DROP INDEX intentional? I think dropping the table drops its index on `Postgres`, `CockroachDB` and `H2` alike.
this index is created on `idempotency_records`
https://github.com/apache/polaris/blob/8775ef417eece1dd7433d186775682be54d40f21/persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql#L170-L171
which we are dropping below
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
ALTER TABLE polaris_schema.events ALTER COLUMN catalog_id DROP NOT NULL;
UPDATE polaris_schema.events SET catalog_id = NULL WHERE catalog_id = '__realm__';
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
Review Comment:
This `DROP TABLE` is a duplicate of the one above the `ALTER`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4006322193
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
From my POV I do not see any benefit in dropping the PK just before we drop the table :thinking:
I assume all RDBMS systems should be able to cascade the table drop into PKs and indexes.
However, I'm fine with current SQL text (I assume it works :sweat_smile: )
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "flyingImer (via GitHub)" <gi...@apache.org>.
flyingImer commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4067868057
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
Review Comment:
Agreed on keeping only DROP TABLE here. These instructions cover v3/v4, but v3 has no idempotency_records table, so the new ALTER TABLE fails and stops the remaining migration statements with ON_ERROR_STOP enabled. The latest #5349 already uses only DROP TABLE IF EXISTS for this cleanup. Could we align this block with it so the cleanup works for both starting versions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3965708670
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
Hello @flyingImer ,
Those were copied from https://github.com/adutra/polaris/blob/0668f5d5279e1cb367e16cc9991966d01352666b/site/content/in-dev/unreleased/metastores/relational-jdbc.md#migration-from-schema-v4-to-v5 (on-going PR from @adutra).
I hasn't try this on my setup but I can test it later this week. We should not merge this PR until the on-going one from @adutra is resolved. This is primary to match to what @adutra has in the on-going PR.
Thanks,
Yong Zheng
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3942657348
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
Hi @adutra and @ayushtkn ,
Yes, this is for matching to https://github.com/adutra/polaris/blob/0668f5d5279e1cb367e16cc9991966d01352666b/site/content/in-dev/unreleased/metastores/relational-jdbc.md.
With implicitly drops, I do think it is easier if people want to revert the changes (as now they see the implicit removal of tables and indices). However, it does make the instructions more lengthy as drop a table would drop the index as well. I am fine with both way. This is mainly created to match to above PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4006580428
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
Also note that `idempotency_records` is expected to be empty. IIRC, the table was never used in released java code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4067962695
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
Review Comment:
ML: https://lists.apache.org/thread/vpfq968ptnnr968ztb51w4tlo70mwqdn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode merged PR #5437:
URL: https://github.com/apache/polaris/pull/5437
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4006961104
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
Review Comment:
To clarify my view on this: I'd prefer to use only this `DROP TABLE` statement for simplicity.
However, current three-statement SQL also looks correct to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3941308985
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
FYI I suggested to @MonkeyCanCode dropping the index too, mostly for completeness. I'm fine not dropping it explicitly though, if you think that's better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4007410548
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
Review Comment:
This statement errors on a v3 database. `idempotency_records` was added in v4, but the paragraph right above says the block is for "an existing v3/v4 database" โ so a v3 operator pastes this and hits an error. If they're running it as one transaction or with psql's `ON_ERROR_STOP`, the `events` fix and the version bump never run either.
Second problem: `idempotency_records_pkey` is Postgres's generated name for an unnamed primary key. v4 declares it inline as `PRIMARY KEY (realm_id, idempotency_key)`, so nothing guarantees that name on H2, which the same paragraph lists as supported.
Both go away if you just delete this line โ `DROP TABLE` below drops the primary key too. Can we cut it (and the `DROP INDEX` above) and keep only the `DROP TABLE`?
<sub>๐ค AI-generated review comment โ agents make mistakes, so please verify before acting on it.</sub>
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
This one can go โ `DROP TABLE` on the next line drops the table's indexes along with it, so the explicit `DROP INDEX` is redundant (and it avoids having to get schema-qualified index syntax right across the three databases this block claims to support).
<sub>๐ค AI-generated review comment โ agents make mistakes, so please verify before acting on it.</sub>
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
This one can go โ `DROP TABLE` on the next line drops the table's indexes along with it, so the explicit `DROP INDEX` is redundant (and it avoids having to get schema-qualified index syntax right across the three databases this block claims to support).
<sub>๐ค AI-generated review comment โ agents make mistakes, so please verify before acting on it.</sub>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on PR #5437:
URL: https://github.com/apache/polaris/pull/5437#issuecomment-5788396759
Thanks for the review @flyrain @flyingImer @dimas-b , based on ML, community would like this keep this simpler and avoid unnecessary SQLs query cascade dependencies.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode closed pull request #5437: Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc
URL: https://github.com/apache/polaris/pull/5437
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3943071604
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
In PSQL, there is none. Drop tables will drop indices (along with all other constraints). This PR was mainly to follow the same pattern that @adutra has in the single SQL PR.
IMO, if we don't want to support fall-back (down-upgrade), we should remove the drop index parts. If we do want to support some fall-back, the approach @adutra has is good. The only thing we may sign ourself up for is to keep those been implicit for other things such as relations etc. later on if certain tables has relations constraints and got dropped in the schema evolution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3942659006
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
ALTER TABLE polaris_schema.events ALTER COLUMN catalog_id DROP NOT NULL;
UPDATE polaris_schema.events SET catalog_id = NULL WHERE catalog_id = '__realm__';
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
Review Comment:
Hello @ayushtkn ,
Yes, this had been updated. Copy/Paste issue. Same responded to the current on-going PR: https://github.com/apache/polaris/pull/5349/changes#r3942654660.
Thanks,
Yong
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4011912854
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,6 +122,9 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
+DROP TABLE IF EXISTS polaris_schema.idempotency_records;
Review Comment:
IMO. We should keep the `DROP TABLE` only for this case as the other two will be auto drop in this case. Doesn't make much sense for an admin to run 2 extra commands that is not must needed. However, i think we need to consolidated with @adutra on his PR. The positive side with list out all changes is if an admin need to reverted, he/she will know what were removed...If he/she only do create table (without creating index/constraint), that would be incomplete revert (assuming we want to support revert?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4006870405
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
That is correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4006483994
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
Yes, drop the base table would cascade on the indices and constraints.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r4002110809
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
Hello @flyingImer ,
I finally got a chance to review this carefully tonight. So the initial copied SQL from above PR is not correct. We have following DDL for this table on v4:
```
POLARIS=# \d idempotency_records
Table "polaris_schema.idempotency_records"
Column | Type | Collation | Nullable | Default
------------------+-----------------------------+-----------+----------+---------
realm_id | text | | not null |
idempotency_key | text | | not null |
operation_type | text | | not null |
resource_id | text | | not null |
http_status | integer | | |
error_subtype | text | | |
response_summary | text | | |
response_headers | text | | |
finalized_at | timestamp without time zone | | |
created_at | timestamp without time zone | | not null |
updated_at | timestamp without time zone | | not null |
heartbeat_at | timestamp without time zone | | |
executor_id | text | | |
expires_at | timestamp without time zone | | |
Indexes:
"idempotency_records_pkey" PRIMARY KEY, btree (realm_id, idempotency_key)
"idx_idemp_realm_expires" btree (realm_id, expires_at)
```
So the right SQL for 2nd index is following (as it is constraint):
```
ALTER TABLE polaris_schema.idempotency_records DROP CONSTRAINT idempotency_records_pkey;
```
cc @adutra , what do u think? Should we be detail on all of these or just drop table and let the backend DB handle the cascading?
Thansk,
Yong
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3942777086
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
Review Comment:
Thanx @adutra and @MonkeyCanCode for sharing the context. I was just curious if there is some functionality difference which I wasnโt aware. I am happy both ways, whichever everyone feels better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Doc: Added missing instructions for schema upgrade from v4 to v5 in 1.7.0 doc [polaris]
Posted by "flyingImer (via GitHub)" <gi...@apache.org>.
flyingImer commented on code in PR #5437:
URL: https://github.com/apache/polaris/pull/5437#discussion_r3961503837
##########
1.7.0/metastores/relational-jdbc.md:
##########
@@ -122,7 +122,10 @@ that are not catalog-scoped. To upgrade an existing v3/v4 database, run the foll
CockroachDB, and H2), then restart Polaris:
```sql
+DROP INDEX IF EXISTS polaris_schema.idx_idemp_realm_expires;
+DROP INDEX IF EXISTS polaris_schema.idempotency_records;
Review Comment:
The duplicate is gone, but the replacement now tries to DROP INDEX on idempotency_records, which is a table in schema v4. PostgreSQL rejects this even with IF EXISTS, so running the upgrade with ON_ERROR_STOP enabled stops before the remaining migration statements. Could we remove that line and keep the DROP TABLE below so the v4 upgrade runs without errors?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org