8000 JPA map storage: Authorization services no-downtime store by vramik · Pull Request #11934 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

JPA map storage: Authorization services no-downtime store - #11934

Merged
hmlnarik merged 1 commit into
keycloak:mainfrom
vramik:9669-authz-jpa-store
May 30, 2022
Merged

hmlnarik merged 1 commit into
keycloak:mainfrom
vramik:9669-authz-jpa-store

Conversation

@vramik
@vramik vramik commented May 11, 2022
Copy link
Copy Markdown
Contributor

Closes #9669

Sending it as a draft as it'd most likely require rebase once #11831 is merged

@vramik vramik added status/ready area/storage Storage layer — JPA entities, database schemas, Liquibase migrations, caching and removed status/ready labels May 11, 2022
@vramik
vramik force-pushed the 9669-authz-jpa-store branch 2 times, most recently from da6d86d to 3de066f Compare May 11, 2022 11:42
@vramik
vramik marked this pull request as ready for review May 11, 2022 13:31
@vramik
vramik requested a review from ahus1 May 11, 2022 13:31
@vramik
vramik force-pushed the 9669-authz-jpa-store branch from 3de066f to 7705fae Compare May 12, 2022 06:56
@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I added some review comments. I'm also run it locally, as in the JPA FAQ from the maven command line. Unfortunately I get the error:
"Caused by: java.lang.IllegalAccessError: Update to non-static final field org.keycloak.models.map.storage.jpa.authSession.entity.JpaAuthenticationSessionEntity.metadata attempted from a different method ($$_hibernate_write_metadata) than the initializer method
at org.keycloak.models.map.storage.jpa.authSession.entity.JpaAuthenticationSessionEntity.$$_hibernate_write_metadata (JpaAuthenticationSessionEntity.java)
"
I need some more time and maybe help to continue the review.

@vramik
vramik force-pushed the 9669-authz-jpa-store branch from 7705fae to d1d1e29 Compare May 12, 2022 12:35
@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@vramik - as discussed, the IllegalAccessError doesn't happen any more after some more full builds; maybe adding the -Pdistribution helped.

I added a review comment about the JDK11 API usage in this module we talked about in the call, please have a look.

@vramik
vramik force-pushed the 9669-authz-jpa-store branch from d1d1e29 to 634badb Compare May 13, 2022 10:24
@ahus1
ahus1 self-requested a review May 13, 2022 12:48
ahus1
ahus1 previously approved these changes May 13, 2022
@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see that the build is green, and a manual test for login worked. I also reviewed all the code changes. Therefore this PR is good to be merged for me.

I'd love to see at least the model tests run for JPA, but this is something for a different PR that would then take care of all tests that might fail with map JPA.

@ahus1
ahus1 self-requested a review May 16, 2022 06:46
@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I found case where a DB constraint might possibly be missing, see below.

@vramik
vramik force-pushed the 9669-authz-jpa-store branch from 22423f8 to 8d2080f Compare May 17, 2022 10:52
@vramik
vramik force-pushed the 9669-authz-jpa-store branch from 8d2080f to cfd7e79 Compare May 21, 2022 10:09
@vramik
vramik force-pushed the 9669-authz-jpa-store branch from cfd7e79 to a3d034f Compare May 23, 2022 15:59
@hmlnarik
hmlnarik requested a review from ahus1 May 23, 2022 20:25
@hmlnarik
hmlnarik requested a review from sguilhen May 23, 2022 20:25
ahus1
ahus1 previously approved these changes May 24, 2022
@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reviewed the latest changes and tested the UI (at least to the point where it triggers the creation of the tables). Thanks for this PR!

@sguilhen sguilhen left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed in the last team call, the authorization models, each having their own table mapping, should have their own JPA entity version.

@vramik
vramik force-pushed the 9669-authz-jpa-store branch from fcef1c3 to 44a1c85 Compare May 27, 2022 12:51
@vramik
vramik requested a review from sguilhen May 30, 2022 07:37
@sguilhen sguilhen left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM now, thank you @vramik !

@hmlnarik hmlnarik left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving per @sguilhen and @ahus1 's approvals

@hmlnarik
hmlnarik merged commit be28e86 into keycloak:main May 30, 2022
@vramik
vramik deleted the 9669-authz-jpa-store branch November 5, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage Storage layer — JPA entities, database schemas, Liquibase migrations, caching

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JPA map storage: Authorization services no-downtime store

4 participants

0