redis wiped out the copied rdb file during it starts

133 views Asked by At

We have encountered a weird redis issue.

  1. After I upgrade my redis from an old version to a new one,
  2. I bring up the redis with clean data.
  3. I copied the previous rdb file into the data direcotry
  4. I restart the redis to load the data.

THen, I figure that my data is wiped out in step 4. Do any of you have encounter this? What could be the possible root cause for this?

We are suspect the redis is getting new request for it. Will that be an possible issue?

1

There are 1 answers

1
Tomasz Poradowski On BEST ANSWER

Before shutting down Redis will persist its data to disk (unless it is completely disabled in config), so you should not try such "hot swapping" of RDB file while Redis server is running - as it simply has overwritten the file on exit. Instead, just stop Redis server and replace RDB file to get it loaded (and later saved back properly).