Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent LRU: The command returns encoded 'OK' message instead of returning the least recently used keys #1263

Open
RhythmAgg opened this issue Nov 10, 2024 · 2 comments

Comments

@RhythmAgg
Copy link

RhythmAgg commented Nov 10, 2024

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
 }
@RhythmAgg
Copy link
Author

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.

@rohan-naik07
Copy link

@arpitbbhayani can I take this up... it will be a good start as a contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants