Skip to content

Removed unused UserSessionPersisterProvider#loadUserSessionsStream for startup and the 25.0.0 session migration - #55319

Draft
ruchikajha95 wants to merge 5 commits into
keycloak:mainfrom
ruchikajha95:iss-55097/UserSessionPersisterProvider-depre
Draft

ruchikajha95 wants to merge 5 commits into
keycloak:mainfrom
ruchikajha95:iss-55097/UserSessionPersisterProvider-depre

Conversation

@ruchikajha95

@ruchikajha95 ruchikajha95 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #55097

@ruchikajha95 ruchikajha95 changed the title Removed unused UserSessionPersisterProvider#loadUserSessionsStream fo… Removed unused UserSessionPersisterProvider#loadUserSessionsStream for startup and the 25.0.0 session migration Nov 19, 2026
@ruchikajha95 ruchikajha95 self-assigned this Nov 19, 2026
…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>
@ruchikajha95
ruchikajha95 force-pushed the iss-55097/UserSessionPersisterProvider-depre branch from 1124f83 to b87da20 Compare November 19, 2026 09:18
@ruchikajha95
ruchikajha95 requested a balanced review from Copilot November 19, 2026 09:19

Copilot AI 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.

🟡 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>

@keycloak-github-bot keycloak-github-bot Bot left a comment

Copy link
Copy Markdown

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

@keycloak-github-bot

Copy link
Copy Markdown

Unreported flaky test detected

If 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

Keycloak CI - Clustering IT

org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63)
	at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)
...

Report flaky test

Copilot AI 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.

🟡 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

@ruchikajha95
ruchikajha95 requested a review from ahus1 November 19, 2026 10:09
Clarified upgrade path for versions older than 25.0.0, emphasizing the need for enabling persistent user sessions.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ruchika Jha <workruchikajha@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused UserSessionPersisterProvider#loadUserSessionsStream for startup and the 25.0.0 session migration

2 participants