Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flushdb not clear all keys in redis?

Tags:

redis

It seems there are still some keys left after i ran redis SHELL command flushdb,

what are these keys used for and why flushdb does not work?

like image 595
liuchuan98 Avatar asked Mar 09 '23 19:03

liuchuan98


1 Answers

When Redis runs flushdb command, it blocks any new writings to the database, and flushes all keys in the database. However, when Redis finishes the flushdb command, it can receive new writings, i.e. other Redis client can put new keys into the database.

In your case, I think there're other clients constantly writing to the database. So after you flush the database, new keys are put into Redis by other clients.

If you want to stop any further writing, you have to shutdown Redis server.

like image 159
for_stack Avatar answered Apr 27 '23 23:04

for_stack