-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Disable cache store only if a remote store is used #24774
Disable cache store only if a remote store is used #24774
Conversation
I've tested this with the following configuration. This is still experimental and not supported, as it uses for example a separate connection pool for each cache. Ideally it should re-use Quarkus' connection pool. Further changes will be necessary to support this in a better way.
Two additional JARs are needed:
This can then be started as follows:
Smoketests I performed: The user session of a logged in user survives a Keycloak restart. Listing of user sessions in the Keycloak UI works as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the below flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.x509.X509BrowserCRLTest#loginSuccessWithCRLSignedWithIntermediateCA3FromTruststoreKeycloak CI - FIPS IT (strict)
|
1 similar comment
Unreported flaky test detectedIf the below flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.x509.X509BrowserCRLTest#loginSuccessWithCRLSignedWithIntermediateCA3FromTruststoreKeycloak CI - FIPS IT (strict)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreported flaky test detected, please review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahus1 Thanks for the improvement. Looks good to me.
I've updated my Infinispan XML above to ensure that sessions are preloaded. This is required for listing sessions of a user / broker. |
model/infinispan/src/main/java/org/keycloak/models/sessions/infinispan/CacheDecorators.java
Outdated
Show resolved
Hide resolved
1b9453a
to
72a799b
Compare
Closes keycloak#10803 Closes keycloak#24766 Signed-off-by: Alexander Schwartz <aschwart@redhat.com> Co-authored-by: daviddelannoy <16318239+daviddelannoy@users.noreply.github.com>
72a799b
to
2b437b7
Compare
@martin-kanis - I've updated the PR after the comment of @daviddelannoy - could you please re-approve the change? |
@ahus1 you have updated to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ahus1, I like this change. I agree we should not limit users that want to use persistence
.
Thanks for bringing it up @daviddelannoy! I checked the code and if the reason for preloading entries is only listing entities it should be ok to preload user sessions only as we are not listing client sessions anywhere. We usually load client sessions only for a specific user session that contains references to the client sessions. @ahus1 Was not preloading client sessions intended or it was only a mistake? |
This was only by mistake and lack of knowledge. Good to see you fixing this. |
Thanks a lot for your help on this subject @ahus1 , @mhajas and @martin-kanis, it is really appreciated. Issue #10803 can be closed too and that's a very good news ! |
Thank you to everyone who participated in this. I'm now merging this. To change the docs and the behavior of Keycloak, please consider creating pull requests. Thank you for @miroRucka for creating the first PR here. At the same time, the the store team at Keycloak might be focusing on other issues like performance, bugs and new features, so our time might be limited. FYI: PRs usually get more attention than feature requests. |
Thank you @ahus1 for promptly addressing the issue, we will test it with the recommended setting. |
As this has been merged yesterday, it is part of tonights nightly Keycloak build for everyone to try. |
@ahus1 it works fine for me with nightly build ! |
@daviddelannoy - thank you for testing this, this is always appreciated! |
Disclaimer: The primary purpose of this is to not stand in the way of people experimenting with persistence in Infinispan's XML. This hasn't been performance tested, and is not a recommended setup. More changes are necessary to make this fully tested and supported, and we might look into different options to make persistence of sessions fully supported which might be incompatible from this one. It is not ideal (and can be problematic) as it uses one additional connection pool per cache, where it should probably reuse Quarkus' connection pool.
The following change will disable the writethrough/readthrough only when a remote store is used. Using a persistence and a remote store at the same time is not supported.
Closes #10803
Closes #24766