redis db is gone after redeploying with a different image

hey, so this might just be me doing something wrong but I’d like to double-check anyways

I have an redis deployed with the following setup:

app = "sumiu-redis"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  image = "flyio/redis:6.2.6"

[env]
  REDIS_PASSWORD="xxx"
  MAXMEMORY_POLICY="noeviction"
  APPENDONLY="yes"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[mounts]]
  destination = "/data"
  source = "redis_data"

[[services]]

This redis is used for cache/sidekiq (I know I shouldn’t do it but this is a tiny project and it doesn’t matter at all). up to this point, I had like 300 jobs processed on sidekiq and a couple of things on the cache. I decided to update the Redis version so I did this:

app = "sumiu-redis"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  image = "redis:7.0.4-alpine3.16"

[env]
  REDIS_ARGS=""

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[mounts]]
  destination = "/data"
  source = "redis_data"

[[services]]

I assumed that since I left the mount intact, it would deploy a new image while still being able to access the data. well, the image was updated successfully but all the data was gone. reverting the image had no effect whatsoever, still no previous data on Redis.

I guess it has to do with how the persistence is configured (APPENDONLY ) but still, I wasn’t expecting a redeploy to nuke the database…what did I do wrong here?

The stock redis image may not be dealing correctly with using /data as the path. You could try logging in to see what’s up there.

Also, assuming you can start fresh, you can try out the preview of the new Upstash Redis managed service. Check out fly redis create.

1 Like

I will fly redis create a try!

ok, so I just gave a try and I see something weird:

I didn’t want to enable eviction:

Upstash Redis can evict objects when memory is full. This is useful when caching in Redis. This setting can be changed later.
Learn more at https://fly.io/docs/reference/redis/#memory-limits-and-object-eviction-policies
? Would you like to enable eviction? No

but according to sidekiq, it will evict the keys:

2022-08-23T10:47:54.315 app[f1bff48c] fra [info] WARNING: Your Redis instance will evict Sidekiq data under heavy load.
2022-08-23T10:47:54.315 app[f1bff48c] fra [info] The 'noeviction' maxmemory policy is recommended (current policy: '').
2022-08-23T10:47:54.315 app[f1bff48c] fra [info] See: https://github.com/mperham/sidekiq/wiki/Using-Redis#memory

edit: and it’s gone

2022-08-23T11:04:50Z app[f1bff48c] fra [info]2022-08-23T11:04:50.893Z pid=515 tid=ftr WARN: Redis::CommandError: ERR max daily request limit exceeded. Limit: 10000, Usage: 10000. See https://docs.upstash.com/overall/databasetypes for details

the free tier is not enough hahahaha

So you saw the error go away before hitting the limits? You should be able to upgrade now to a higher plan as well.

Also, the Redis db will not evict. It just doesn’t support querying for maxmemory_policy yet. That may be added later, but rest assured that eviction will not be enabled unless you choose that :slight_smile:

1 Like