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

website/docs: next release notes: add upgrade instructions for postgres to 16 #9727

Merged
merged 31 commits into from
May 29, 2024

Conversation

4d62
Copy link
Contributor

@4d62 4d62 commented May 14, 2024

Details

Provides documentation to upgrade authentik-postgresql to PG v16

closes #9628


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

4d62 added 2 commits May 14, 2024 17:00
Signed-off-by: 4d62 <157558804+4d62ext@users.noreply.github.com>
Copy link

netlify bot commented May 14, 2024

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 3208e66
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/6654c0661cc7d90008376512

Copy link

netlify bot commented May 14, 2024

Deploy Preview for authentik-docs failed.

Name Link
🔨 Latest commit 69f9099
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6654b16cf2eaf80009948b49

Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.64%. Comparing base (fd66be9) to head (3208e66).
Report is 57 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9727   +/-   ##
=======================================
  Coverage   92.64%   92.64%           
=======================================
  Files         710      710           
  Lines       34706    34745   +39     
=======================================
+ Hits        32152    32189   +37     
- Misses       2554     2556    +2     
Flag Coverage Δ
e2e 49.66% <ø> (-0.01%) ⬇️
integration 25.50% <ø> (-0.02%) ⬇️
unit 90.09% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jehy
Copy link

jehy commented May 14, 2024

Great PR! Just several hours ago I independently upgraded to postgres 16, there were no problems and it seems like authentik is working much faster.

@4d62
Copy link
Contributor Author

4d62 commented May 14, 2024

Great PR! Just several hours ago I independently upgraded to postgres 16, there were no problems and it seems like authentik is working much faster.

Thanks! Out of curiosity, did you update with an existing database or did you recreate it? I'm currently facing the error psycopg.errors.DuplicateTable: relation "authentik_events_event" already exists and i'm looking for ways to make the upgrade easier. From wha I saw, it's impossible (unless i only saw the errors and not the success) to restore database from upgrade_backup_12.sql without purging it first due to already existing table errors.

@4d62
Copy link
Contributor Author

4d62 commented May 14, 2024

also for project maintainers @BeryJu / @rissson, where should I put the markdown file once completed?

@rissson
Copy link
Member

rissson commented May 14, 2024

We'll probably include this in the release notes, so website/docs/releases/2024/next.md, which you can create from the template.

@rissson
Copy link
Member

rissson commented May 14, 2024

Great PR! Just several hours ago I independently upgraded to postgres 16, there were no problems and it seems like authentik is working much faster.

Yeah we've been testing 16 in CI pretty much since in came out, no issue. Interesting that it seems to be faster though!

@4d62
Copy link
Contributor Author

4d62 commented May 14, 2024

Ok. thanks for the quick response. Regarding my issue, do you have any other suggestions or would you do it differently?

@rissson
Copy link
Member

rissson commented May 14, 2024

Great PR! Just several hours ago I independently upgraded to postgres 16, there were no problems and it seems like authentik is working much faster.

Thanks! Did you update with an existing database or did you recreate it? I'm currently facing the error psycopg.errors.DuplicateTable: relation "authentik_events_event" already exists and i'm looking for ways to make the upgrade easier. From wha I saw, it's impossible (unless i only saw the errors and not the success) to restore database from upgrade_backup_12.sql without purging it first due to already existing table errors.

You shouldn't need to re-create a database, restoring your dump file should be enough. pg_dump has arguments to delete objects if they already exist (-c, -C). The tables probably got re-created because authentik was running and thus executed its migrations as if it was a new install. As such, it should be shut down during the whole operation. The best way would be to cut off connections to postgresql completely, so network: none (don't remember the exact syntax) for a docker-compose installation, and firewalling for a standard postgres install.

@4d62
Copy link
Contributor Author

4d62 commented May 14, 2024

I'll try that soon. Thanks!

@4d62
Copy link
Contributor Author

4d62 commented May 14, 2024

Regarding K8s, someone would have to write the documentation as I don't really have any experience with it

@rissson
Copy link
Member

rissson commented May 14, 2024

Regarding K8s, someone would have to write the documentation as I don't really have any experience with it

We distribute postgres 15 with the helm chart, so we won't be upgrading that one soon.

@4d62
Copy link
Contributor Author

4d62 commented May 15, 2024

@rissson I think this is ready for first review

@4d62 4d62 marked this pull request as ready for review May 15, 2024 00:06
@4d62 4d62 requested review from a team as code owners May 15, 2024 00:06
@4d62 4d62 changed the title [DRAFT] docs: upgrade postgres to v16 docs: upgrade postgres to v16 May 15, 2024
@rissson rissson mentioned this pull request May 15, 2024
6 tasks
4d62 and others added 5 commits May 22, 2024 20:07
Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com>
Signed-off-by: 4d62 <157558804+4d62ext@users.noreply.github.com>
Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com>
Signed-off-by: 4d62 <157558804+4d62ext@users.noreply.github.com>
Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com>
Signed-off-by: 4d62 <157558804+4d62ext@users.noreply.github.com>
Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com>
Signed-off-by: 4d62 <157558804+4d62ext@users.noreply.github.com>
Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com>
Signed-off-by: 4d62 <157558804+4d62ext@users.noreply.github.com>
@4d62
Copy link
Contributor Author

4d62 commented May 23, 2024

Great info and steps to have, thanks @4d62ext !

No problem and thanks for the quick review.

@4d62 4d62 requested a review from tanberry May 23, 2024 00:10
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@rissson
Copy link
Member

rissson commented May 23, 2024

@BeryJu something like this? tried adding headers like the example you provided

@rissson rissson closed this May 23, 2024
@rissson rissson reopened this May 23, 2024
@rissson
Copy link
Member

rissson commented May 23, 2024

I'm so sorry, I misscliked.

something like this? tried adding headers like the example you provided

Yes!

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@4d62 4d62 closed this May 27, 2024
@4d62 4d62 deleted the docker-compose-n-docs/update-pg-to-v16 branch May 27, 2024 02:14
@4d62 4d62 restored the docker-compose-n-docs/update-pg-to-v16 branch May 27, 2024 02:15
@4d62 4d62 reopened this May 27, 2024
@4d62
Copy link
Contributor Author

4d62 commented May 27, 2024

my bad, tried renaming branch on my fork

4d62 and others added 3 commits May 27, 2024 12:12
Signed-off-by: 4d62 <ext@4d62.me>
Signed-off-by: 4d62 <ext@4d62.me>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Copy link
Contributor

@tanberry tanberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @4d62ext !

@rissson rissson merged commit f388cac into goauthentik:main May 29, 2024
60 of 66 checks passed
@4d62 4d62 deleted the docker-compose-n-docs/update-pg-to-v16 branch May 29, 2024 14:44
@4d62
Copy link
Contributor Author

4d62 commented May 29, 2024

Thanks again @4d62ext !

no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Q: Using Postgres V16 in docker-compose instead of V12
5 participants