charts icon indicating copy to clipboard operation
charts copied to clipboard

[stable/redis-ha]: add redis source to restore options

Open hawwwdi opened this issue 1 year ago • 1 comments

What this PR does / why we need it:

This PR adds support for using a remote Redis instance as a data source for restoration. It utilizes the redis-cli --rdb command to perform the restore operation.

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • [x] DCO signed
  • [x] Chart Version bumped
  • [x] Variables are documented in the README.md
  • [x] Title of the PR starts with chart name (e.g. [stable/mychartname])

hawwwdi avatar Sep 11 '24 13:09 hawwwdi

@DandyDeveloper

hawwwdi avatar Sep 16 '24 11:09 hawwwdi

@hawwwdi Can we work through those inline changes your IDE has updated and undo them for now?

Also, can you provide some logging showing a successful restore operation? Backups testing locally for me is a bit of a nightmare :)

DandyDeveloper avatar Nov 05 '24 16:11 DandyDeveloper

@DandyDeveloper, I have fixed those inline changes and rolled them back. Additionally, I’ve made some changes to the restoration script: it is now only executed for the initial master instance and checks the connectivity of the provided Redis endpoint to prevent getting stuck in a crashLoopBackOff state in case of a pod restart.

hawwwdi avatar Nov 07 '24 20:11 hawwwdi

example logs of a successful restore operation: restore-redis init container:

k logs -n redis test-redis-ha-server-0 -c restore-redis -f   
test-redis.test-restore:6379 (10.105.192.181:6379) open
sending REPLCONF capa eof
sending REPLCONF rdb-only 1
SYNC sent to master, writing 7477632846 bytes to '/data/dump.rdb_'
Transfer finished with success.
'/data/dump.rdb_' -> '/data/dump.rdb'

redis instance:

k exec -it -n redis test-redis-ha-server-0 -- sh -c "echo info | redis-cli | tail -2"  
Defaulted container "redis" out of: redis, sentinel, split-brain-fix, redis-exporter, config-init (init), restore-redis (init)
# Keyspace
db1:keys=107713981,expires=0,avg_ttl=0

hawwwdi avatar Nov 07 '24 20:11 hawwwdi

@DandyDeveloper Could you please review this?

hawwwdi avatar Nov 26 '24 20:11 hawwwdi

@DandyDeveloper reminder

hawwwdi avatar Dec 21 '24 23:12 hawwwdi

I'll get it checked and if all good, I'll merge tomorrow!

DandyDeveloper avatar Dec 21 '24 23:12 DandyDeveloper

@hawwwdi I'll approved to get the test run but can you make this a minor rather than a patch? It's a big addition. The versioning should probably reflect this.

DandyDeveloper avatar Dec 22 '24 22:12 DandyDeveloper

@hawwwdi I'll approved to get the test run but can you make this a minor rather than a patch? It's a big addition. The versioning should probably reflect this.

I fixed it.

hawwwdi avatar Dec 22 '24 22:12 hawwwdi