Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The stateless-mode guard still rejects custom stacks containing KEYCLOAK_JDBC_PING2 before reaching the new injection path, preventing valid JDBC-backed configurations from starting.
1 open issue
What changed in this PR
This PR addresses #54539 by enabling custom XML-defined JGroups stacks to use Keycloak’s database-backed discovery while retaining custom protocol 8000 settings.
Changes:
- Wraps custom stacks to inject the database connection factory and apply shared JDBC defaults without overriding XML values.
- Rejects unsupported file-based and cross-site configurations using
KEYCLOAK_JDBC_PING2. - Adds custom-stack tests and changes a test protocol ID to avoid registration conflicts.
| File | Description |
|---|---|
model/infinispan/src/test/java/org/keycloak/spi/infinispan/impl/embedded/JGroupsConfiguratorCustomStackTest.java |
Tests factory injection, property precedence, stack preservation, and cross-site rejection. |
model/infinispan/src/test/java/org/keycloak/jgroups/protocol/JdbcPing2Test.java |
Uses a non-conflicting test protocol ID. |
model/infinispan/src/main/java/org/keycloak/spi/infinispan/impl/embedded/JGroupsConfigurator.java |
Adds custom-stack wrapping, shared JDBC defaults, and unsupported-configuration checks. |
Review effort: Balanced
6ec7b57 to
775be2a
Compare
|
@ruchikajha95 - I needed to rebase the PR due to a merge conflict to the your PR that I merged earlier. CI is still running. |
There was a problem hiding this comment.
🟡 Changes recommended
Transport detection can misclassify SHARED_LOOPBACK_PING and bypass the stateless JDBC discovery guard, while wrapper stack-name collisions can cause valid configurations to fail at startup.
2 open issues
1 resolved since last review
Review effort: Balanced
|
CI failing due to #54622, waiting for that PR to be merged. |
b8f0103 to
89034fe
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The custom-stack path skips address pre-registration that guards against split brain, while tests never start wrapped channels, leaving clustering safety unresolved pending multi-node startup validation against the pinned runtime.
No open issues 🎉
Review effort: Balanced
d0d79e8 to
0b6ec37
Compare
There was a problem hiding this comment.
LGTM . Thanks @ahus1
… connection factory Closes keycloak#54539 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
…C_PING2 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
0b6ec37 to
be57456
Compare

Closes #54539
When a custom stack defined in the XML configuration uses
KEYCLOAK_JDBC_PING2, the stack is now wrapped in a configurator that injects theJpaConnectionProviderFactory, as for the built-injdbc-pingstacks.The JDBC_PING SQL statements and related properties are extracted into a shared helper and applied as defaults, so values set in the XML take precedence.
Unsupported setups fail at startup: stacks loaded from a
stack-file, and stacks with cross-site (RELAY2) settings.The wrapped stack is registered as
<stack>-keycloak, as Infinispan rejects duplicate stack names.The JGroups address is not pre-registered in the
JGROUPS_PINGtable for custom stacks.Tests cover a stack that extends
tcp, removesFD_SOCK2and replacesMPING, plus default/override precedence, a stack without the protocol, and the cross-site rejection.