Add currdb command to get current db value.#8139
Add currdb command to get current db value.#8139hpatro wants to merge 1 commit intoredis:unstablefrom
Conversation
|
We can also get this from client info, there is a new field coming in #8113, so it might not be worth adding a dedicated command for it. We also need to make sure this works with older versions of Redis as well, since you can run the newer CLI with the older redis version that doesn't have the command. |
|
Also note this from the
|
|
I remembered long time ago I opened an issue similar to this: #6727. I think currently cli implementation caching the db number in client side, but in some cases, from the reply we cannot guarantee the select command was executed successfully, therefore causing inconsistencies. If there is some way we can get current db info and refactor cli code, we can elimiate this issue. |
|
@hpatro Can we drop this PR? |
Currently during cli connect of Redis CLI, if it fails to SELECT a database (due to ACL permissions), the user lands onto database 0. However the Redis CLI prompt states otherwise which is confusing to the end user. For e.g.
As we can see in the above scenario, the current client is pointing to 0 db index instead of 1.
After the proposed changes, redis-cli warns about the failure of selection of database as well as displays the current database index the client is pointing to.