Skip to content

Fix stateless cluster and db migrations race - #51357

Merged
ahus1 merged 1 commit into
keycloak:mainfrom
slaskawi:51154/stateless_migration
Aug 2, 2026
Merged

Fix stateless cluster and db migrations race#51357
ahus1 merged 1 commit into
keycloak:mainfrom
slaskawi:51154/stateless_migration

Conversation

@slaskawi

@slaskawi slaskawi commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This Pull Request fixes a race condition between triggering the migration and bootstrapping Infinispan cluster.

The race condition has been noticed in UDS Platform.

Related tickets

Closes #51154

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
@slaskawi
slaskawi force-pushed the 51154/stateless_migration branch from 18e45ce to 5398acc Compare August 1, 2026 20:15
@ahus1 ahus1 self-assigned this Aug 2, 2026
@ahus1
ahus1 requested a review from Copilot August 2, 2026 11:30

@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.

This looks good to me; please switch to "ready" once you're good with this change.

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.

🟢 Ready to approve

The lifecycle race is correctly addressed and covered by a focused regression test.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Fixes stateless startup during database migrations by avoiding factory lifecycle-dependent cluster state.

Changes:

  • Resolves NodeInfo and marshaller from the active session.
  • Adds regression coverage for provider use before postInit().
File summaries
File Description
DatabaseAwareClusterProviderFactory.java Removes prematurely captured factory state.
DatabaseAwareClusterProviderFactoryTest.java Tests pre-postInit() event notification.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@slaskawi
slaskawi marked this pull request as ready for review August 2, 2026 16:34
@slaskawi
slaskawi requested review from a team as code owners August 2, 2026 16:34
@slaskawi

slaskawi commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

This looks good to me; please switch to "ready" once you're good with this change.

Thanks @ahus1 ! Ready for review/merge!

@ahus1
ahus1 merged commit f0e9bef into keycloak:main Aug 2, 2026
92 checks passed
@ahus1

ahus1 commented Aug 2, 2026

Copy link
Copy Markdown
Member

@slaskawi - merged! Can you please provide a backport to 26.7? Thanks!

@slaskawi

slaskawi commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@ahus1 Absolutely! #51406

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.

Upgrade to 26.7.0 fails with preview features as the stateless cluster provider captures a null NodeInfo before postInit

3 participants