Open rukai opened 1 year ago
There was an attempt to resolve this issue at https://github.com/shotover/shotover-proxy/pull/704 The issue is still valid but the attempt to resolve it stalled out due to redis being a low priority right now. We should continue where we left off on that PR in order to resolve this issue.
Pulled out of https://github.com/shotover/shotover-proxy/pull/645 which uncovered the issue:
By dumping the requests/responses in RedisSinkSingle and running
cargo test cassandra_int_tests::test_cassandra_redis_cache
we get:The attempted FLUSHDB request is incorrect because it is sent as a single bulk string instead of an array of bulk strings. The single invalid FLUSHDB request is causing redis to generate two responses. This is quite concerning as it violates a documented transform invariant.
I confirmed the behavior occurs on redis 5, 6 and 7
According to the spec https://redis.io/docs/reference/protocol-spec/#resp-protocol-description
So it sounds like if we send anything other than an Array of Bulk Strings to the server than all bets are off on how redis interprets the request. I propose we add a check to the shotover sinks to filter out any such invalid requests so that shotover maintains its invariants even when given garbage input.
I suspect we will need to implement this within each redis sink so lets wait for https://github.com/shotover/shotover-proxy/pull/645 to land first.