I have taken a look further into the 10.1.x and 11.0.x branches of Infinispan source code, trying to find the IDs referenced by the "Unknown command" lines. From the OP of this thread the ID was 17. From mine the IDs were 90 and 85. The key term searched for was declaration of "COMMAND_ID". The following are what I found:
11.0.x branch:
./core/src/main/java/org/infinispan/commands/topology/RebalanceStatusRequestCommand.java: public static final byte COMMAND_ID = 90;
./core/src/main/java/org/infinispan/commands/topology/CacheJoinCommand.java: public static final byte COMMAND_ID = 85;
./core/src/main/java/org/infinispan/commands/irac/IracClearKeysCommand.java: public static final byte COMMAND_ID = 17;
10.1.x branch:
./core/src/main/java/org/infinispan/topology/CacheTopologyControlCommand.java: public static final byte COMMAND_ID = 17;
(none found for COMMAND_ID = 85 or 90).
For Command ID 17, reading between IracClearKeysCommand.java (11.0.x) and CacheTopologyControlCommand.java (10.1.x), one common thing is both classes are referenced in ./core/src/main/java/org/infinispan/commands/RemoteCommandsFactory.java. The difference is IracClearKeysCommand.COMMAND_ID (17) is in "public CacheRpcCommand fromStream" (line 459 in 11.0.x version but not in 10.1.x one), while CacheTopologyControlCommand.COMMAND_ID (also 17) is in "public ReplicableCommand fromStream" (line 156 in 10.1.x but not in 11.0.x), which leads me to believe they serve different functions. The line number "RemoteCommandsFactory.java:264" in the OP's stack matches the "switch" and "default" part in "public ReplicableCommand fromStream" within the Infinispan 11.0.x version of RemoteCommandsFactory.java (Note IracClearKeysCommand.COMMAND_ID is instead in the other "public CacheRpcCommand fromStream" (line 459)). In the OP case the exception was thrown in the 11.0.x version of RemoteCommandsFactory.java line 264 because Command ID 17 is not in there, while mine was most likely thrown in 10.x version of same file within the same method because Command IDs 90 and 85 were not there. So this is a case of two different versions of Infinispan talking to each other.
My previous assumption of the Hot Rod protocol version is probably not relevant. The Hot Rod protocol versions for both branches can also be found here:
./client/hotrod-client/src/main/java/org/infinispan/client/hotrod/ProtocolVersion.java
Both defaults to the same 3.0 version.
I have not had a chance to look further into Infinispan documentations, but if there is a way to cluster/upgrade/transition Infinispan 10.x to 11.0.x to allow both versions of servers to co-exist or share the cache, such as configuring Infinispan 11.0.x to use the older 10.x command set (ie backward compatibility) we could use that to smoothly transit the Keycloak from 11 to 12 maybe? ie, to configure Keycloak 12.0.x's infinispan to use the older command set, if at all possible.