Skip to content
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

CrossDCTest: Unable to load keys for caches that use UUID as key #628

Closed
mhajas opened this issue Dec 13, 2023 · 4 comments · Fixed by #853
Closed

CrossDCTest: Unable to load keys for caches that use UUID as key #628

mhajas opened this issue Dec 13, 2023 · 4 comments · Fixed by #853
Assignees
Labels
enhancement New feature or request

Comments

@mhajas
Copy link
Contributor

mhajas commented Dec 13, 2023

No description provided.

@mhajas mhajas added the enhancement New feature or request label Dec 13, 2023
@mhajas mhajas assigned mhajas and unassigned mhajas Dec 13, 2023
@mhajas
Copy link
Contributor Author

mhajas commented Dec 13, 2023

There are two options

  1. Use HotRod protocol to access the remote store with JBossMarshalling
  2. Use Dataset provider functionality to access remote caches: https://github.com/keycloak/keycloak-benchmark/blob/main/dataset/src/main/java/org/keycloak/benchmark/cache/RemoteCacheResource.java

Option 2. is better, although it has some disadvantages like it is not secured and won't work if Keycloak is down.

@ahus1
Copy link
Contributor

ahus1 commented Jan 8, 2024

@mhajas - is this still necessary / still a problem? Can you add more context here if it is still necessary?

@mhajas
Copy link
Contributor Author

mhajas commented Jan 9, 2024

Sure. Yes, this is still necessary in my opinion.

The issue here is that the CrossDC testsuite accesses Infinispan caches using ISPN's Rest API. This works well for some simple tasks, for example cache size but not for more difficult tasks.

For example, we are currently not able to list keys for client session cache because the cache uses UUID key type and the REST API do not have support for that. btw. it is also hard to list user session keys (we need to do some nasty magic to parse it from REST API response).

The solution to this is to use something that understands the cache structure for these calls. There are two options:

  1. Using HotRod client (we would need to get KC Externalizers from KC codebase to CrossDC testsuite so this is probably too difficult)
  2. Use Dataset provider functionality to access remote caches: https://github.com/keycloak/keycloak-benchmark/blob/main/dataset/src/main/java/org/keycloak/benchmark/cache/RemoteCacheResource.java

The second option is preferred as it is already implemented in dataset provider. The missing part is to implement https://github.com/keycloak/keycloak-benchmark/blob/main/provision/rosa-cross-dc/keycloak-benchmark-crossdc-tests/src/test/java/org/keycloak/benchmark/crossdc/client/InfinispanClient.java interface with calls to Dataset provider. As a nice to have would be to filter the sessions we are obtaining based on the realm as currently, we need to do another nasty magic to remove session ids created by Keycloak Admin Client from master realm.

The advantage of 1. would be we are not dependent on the dataset provider (which we are anyway with lb-check) and would be secured as the dataset provider is not secured at all.

@mhajas
Copy link
Contributor Author

mhajas commented Jun 13, 2024

Revert b0a408a when this is resolved

pruivo added a commit to pruivo/keycloak-benchmark that referenced this issue Jun 14, 2024
* Enables protostream encoding in the external Infinispan
* Changes the testsuite to use the Hot Rod client

Closes keycloak#628

Signed-off-by: Pedro Ruivo <pruivo@redhat.com>
mhajas pushed a commit that referenced this issue Jun 19, 2024
* Enables protostream encoding in the external Infinispan
* Changes the testsuite to use the Hot Rod client

Closes #628

Signed-off-by: Pedro Ruivo <pruivo@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants