Repository navigation
Removed unused UserSessionPersisterProvider#loadUserSessionsStream for startup and the 25.0.0 session migration - #55319
Conversation
…r startup and the 25.0.0 session migration Closes keycloak#55097 Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
Closes keycloak#55097 Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
Closes keycloak#55097 Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
1124f83 to
b87da20
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A test fails with embedded Infinispan and persistent sessions disabled, cleanup assertions can miss leftover session rows, and the upgrade guidance may lead to lost online sessions.
4 open issues
What changed in this PR
Removes obsolete startup session-loading APIs and the Keycloak 25 remote-session migration, simplifying session persistence for Keycloak 27.
Changes:
- Removes the unused bulk-loading SPI method, implementations, and supporting queries.
- Deletes the legacy migration and CLI command, and adapts model tests to existing read-only APIs.
- Documents the unsupported direct upgrade path from versions older than 25.
| File | Description |
|---|---|
testsuite/utils/src/main/java/org/keycloak/testsuite/util/cli/TestsuiteCLI.java |
Unregisters the removed session-loading command. |
testsuite/utils/src/main/java/org/keycloak/testsuite/util/cli/LoadPersistentSessionsCommand.java |
Deletes the obsolete CLI command. |
testsuite/model/src/test/java/org/keycloak/testsuite/model/session/UserSessionProviderOfflineModelTest.java |
Replaces removed loader calls with read-only streams. |
testsuite/model/src/test/java/org/keycloak/testsuite/model/session/UserSessionPersisterProviderTest.java |
Adapts persistence tests to realm-scoped loading. |
model/storage-private/src/main/java/org/keycloak/models/session/UserSessionPersisterProvider.java |
Removes the startup bulk-loading SPI method. |
model/storage-private/src/main/java/org/keycloak/models/session/DisabledUserSessionPersisterProvider.java |
Removes the corresponding disabled implementation. |
model/jpa/src/main/java/org/keycloak/models/jpa/session/PersistentUserSessionEntity.java |
Removes the bulk user-session query. |
model/jpa/src/main/java/org/keycloak/models/jpa/session/PersistentClientSessionEntity.java |
Removes the client-session interval query. |
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java |
Deletes the obsolete loader and supporting helper. |
model/infinispan/src/main/java/org/keycloak/models/sessions/infinispan/remote/RemoteUserSessionProvider.java |
Removes the Keycloak 25 database-to-cache migration. |
docs/documentation/upgrading/topics/changes/changes-27_0_0.adoc |
Adds upgrade-path guidance for pre-25 installations. |
Review effort: Balanced
Closes keycloak#55097 Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
Unreported flaky test detectedIf the 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.cluster.RealmInvalidationClusterTest#crudWithFailover |
There was a problem hiding this comment.
🟡 Changes recommended
The upgrade guide recommends an unsafe path through version 26, and the regression test no longer verifies that sessions and their client sessions can be loaded after expiration.
2 open issues
4 resolved since last review
Review effort: Balanced
| // try to load user session from persister | ||
| Assert.assertEquals(2, persister.loadUserSessionsStream(0, 10, true, "").count()); | ||
| // try to load user session from persister - count actual persisted rows regardless of expiration | ||
| Assert.assertEquals(2, persister.getUserSessionsCount(true)); |
| * Upgrade to {project_name} 26.x (recommended, as persistent user sessions are enabled by default), allow the session migration to complete, then upgrade to 27.0.0. | ||
| * Alternatively, upgrade to {project_name} 25.x with the `persistent-user-sessions` feature explicitly enabled, allow the session migration to complete, then upgrade to 27.0.0. |
Closes #55097