dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.31k stars 912 forks source link

Additional request around notify-keyspace-events to support Spring Data #3708

Open danielloader opened 4 days ago

danielloader commented 4 days ago

Is your feature request related to a problem? Please describe. Spring Data Redis repository likes to set config values and when it can't it bombs out on start.

https://github.com/spring-projects/spring-data-redis/issues/2670

Caused by: io.lettuce.core.RedisCommandExecutionException: ERR Unknown option or number of arguments for CONFIG SET - 'notify-keyspace-events'
    at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:147) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:116) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:63) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:745) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:680) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:597) ~[lettuce-core-6.3.2.RELEASE.jar!/:6.3.2.RELEASE/8941aea]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) ~[netty-common-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.110.Final.jar!/:4.1.110.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.110.Final.jar!/:4.1.110.Final]
    at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]

I'm trying to use Redis (and in this case DragonflyDB) as a shared session store for a high availability SpringBoot based application.

Describe the solution you'd like I'd like to be able to use Spring Data Redis with DragonflyDB.

Describe alternatives you've considered Keep using Redis sentinel and become increasingly despondent with the experience in EKS.

Additional context

Related to https://github.com/dragonflydb/dragonfly/issues/1657

https://www.shinyproxy.io/documentation/configuration/#session-persistence-and-aws-elasticache - upstream configuration details for elasticache that disables this by default so explicit configuration is needed there.

Using DragonflyDB 1.22.1 via the Operator with 3 replicas.

adiholden commented 2 days ago

Hi @danielloader I am closing as we already have open issue for supporting keyspace notifications

3618

romange commented 2 days ago

@adiholden I think the issue here is different. We currently allow enabling the notifications only via a flag, and the issue here is about enabling it via "config set"

danielloader commented 2 days ago

If the functionality works via a flag I can always follow the same guide as AWS elasticache and enable that out of band in the cache side.

That said yes the original ask was that spring data just works without additional hurdles.

Edit: What's the flag configuration to enable it?

dranikpg commented 2 days ago

Same as with redis: notify-keyspace-events. Please note we only support Ex option

danielloader commented 2 days ago

Thanks, yeah in which case without EA I guess how I get it configured is a bit premature then.