Netflix / dynomite

A generic dynamo implementation for different k-v storage engines
Apache License 2.0
4.19k stars 531 forks source link

[Unsupported] Allow setting per-connection consistency through fake R… #728

Closed smukil closed 4 years ago

smukil commented 4 years ago

…edis cmd

Ideally we shouldn't be doing this and should have a connection handshake stage to set connection level configuration. However, this is quite urgent for a specific use-case at the moment and will be changed in the future. Production code relying on this is not a good idea.

In this we introduce a new fake Redis command that's parsed by the Redis parser called: 'DYNO_CONFIG:CONN_CONSISTENCY '

This will change the consistency level only for that connection.

A new Dynomtie parsing result called MSG_PARSE_DYNO_CONFIG signifies a connection level configuration was received. We simulate a response to the client by replying with "+OK\r\n".

Testing: Made sure that a key with a quorum failure is accessible after calling 'DYNO_CONFIG:CONN_CONSISTENCY DC_ONE' in the same client session.