Inconsistent `LRU`: The command returns encoded 'OK' message instead of returning the least recently used keys
Steps to reproduce
- Connect to diceDB
- launch dicedb-cli
- Enter command : SET k1 v1
- Enter command: LRU
Expected output
The output expected is the list of keys that are least recently used ( according to the Dice DB docs ).
1.) k1
Observed output
The output observed it the 'OK' message.
LRU command eval function
/* /internals/eval/eval.go
evalLRU deletes all the keys from the LRU
returns encoded RESP OK
*/
func evalLRU(args []string, store *dstore.Store) []byte {
dstore.EvictAllkeysLRUOrLFU(store)
return clientio.RespOK
}
We can have EvictAllKeysLRUorLFU to return the list of keys and send the list to the CLI. Also the doc doesn't mention if the intended usecase is to remove all the LRU keys or just return the list to the clients for their information. @AshwinKul28 @JyotinderSingh please let me know your thoughts on this.
@arpitbbhayani can I take this up... it will be a good start as a contributor
Is LRU command supported? it throws "unknown command" error.
Can I take up this issue?