Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neon extension did not get auto-upgraded #7003

Closed
skyzh opened this issue Mar 4, 2024 · 3 comments · Fixed by #7029
Closed

neon extension did not get auto-upgraded #7003

skyzh opened this issue Mar 4, 2024 · 3 comments · Fixed by #7029
Assignees
Labels
c/compute Component: compute, excluding postgres itself t/bug Issue Type: Bug

Comments

@skyzh
Copy link
Member

skyzh commented Mar 4, 2024

Steps to reproduce

postgres=> \dx
                                            List of installed extensions
        Name        | Version |   Schema   |                              Description
--------------------+---------+------------+------------------------------------------------------------------------
 neon               | 1.1     | neon       | cloud storage for PostgreSQL
 pg_stat_statements | 1.10    | public     | track planning and execution statistics of all SQL statements executed
 plpgsql            | 1.0     | pg_catalog | PL/pgSQL procedural language
(3 rows)

postgres=> select * from neon_stat_file_cache;
ERROR:  relation "neon_stat_file_cache" does not exist
LINE 1: select * from neon_stat_file_cache;
                      ^
postgres=> select * from neon.neon_stat_file_cache;
ERROR:  relation "neon.neon_stat_file_cache" does not exist
LINE 1: select * from neon.neon_stat_file_cache;
                      ^
postgres=> alter extension neon update to '1.3';
ERROR:  must be owner of extension neon
postgres=>

Expected result

Upgraded to 1.3 on prod

Actual result

Stay at 1.1

Environment

Logs, links

@skyzh skyzh added t/bug Issue Type: Bug c/compute Component: compute, excluding postgres itself labels Mar 4, 2024
@skyzh skyzh self-assigned this Mar 4, 2024
@skyzh
Copy link
Member Author

skyzh commented Mar 4, 2024

likely due to skip_catalog_updates. should include compute version into the compute spec.

@andreasscherbaum
Copy link
Contributor

Stas: It affects cold start times if we upgrade the extension on every start.

Anastasia: Introduce flag if compute version changes, then roll upgrade.

@skyzh
Copy link
Member Author

skyzh commented Mar 5, 2024

Will solve this specific problem by either introducing a new flag on the cloud side, or do an always-enabled migration on the compute side. The broader problem is tracked in #6936.

skyzh added a commit that referenced this issue Mar 6, 2024
## Problem

Fix #7003. Fix
#6982. Currently, neon
extension is only upgraded when new compute spec gets applied, for
example, when creating a new role or creating a new database. This also
resolves `neon.lfc_stat` not found warnings in prod.

## Summary of changes

This pull request adds the logic to spawn a background thread to upgrade
the neon extension version if the compute is a primary. If for whatever
reason the upgrade fails, it reports an error to the console and does
not impact compute node state.

This change can be further applied to 3rd-party extension upgrades. We
can silently upgrade the version of 3rd party extensions in the
background in the future.

Questions:

* Does alter extension takes some kind of lock that will block user
requests?
* Does `ALTER EXTENSION` writes to the database if nothing needs to be
upgraded? (may impact storage size).

Otherwise it's safe to land this pull request.

Signed-off-by: Alex Chi Z <chi@neon.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/compute Component: compute, excluding postgres itself t/bug Issue Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants