redis / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
http://redis.io
Other
66.7k stars 23.77k forks source link

[BUG] Inspite of disabling the redis persistance both AOF and RDB, RDB is loading keys of diffrent master leading to keys importing #10457

Open sreenivasvp opened 2 years ago

sreenivasvp commented 2 years ago

Inspite of disabling the redis persistance both AOF and RDB, RDB is loading keys of diffrent master leading to keys importing Our redis configuration details : Redis Configuration details

cluster-node-timeout 60000 cluster-slave-validity-factor 3 cluster-allow-reads-when-down no appendonly no save "" cluster-enabled yes cluster-config-file nodes-redis.conf dir /var/lib/redis protected-mode no

We see that nodes.conf nodes-redis.conf details ef1d9da0aee94b41ae4bfe17c5b8c2e22527fd35 10.192.210.19:6379@16379 myself,master - 0 1646379500000 8 connected 5461-10922

While bootup, we see -> Done loading RDB, keys loaded: 2, keys expired: 0. Keys are from diffferrnt master leading to slot importing 15:M 17 Mar 2022 22:57:16.512 # I have keys for slot 11794, but the slot is assigned to another node. Setting it to importing state. 15:M 17 Mar 2022 22:57:16.512 # I have keys for slot 13796, but the slot is assigned to another node. Setting it to importing state.

Snippet of boot log :

Starting redis server

15:C 17 Mar 2022 22:57:16.498 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 15:C 17 Mar 2022 22:57:16.498 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=15, just started 15:C 17 Mar 2022 22:57:16.498 # Configuration loaded 15:M 17 Mar 2022 22:57:16.499 monotonic clock: POSIX clock_gettime 15:M 17 Mar 2022 22:57:16.507 Node configuration loaded, I'm ef1d9da0aee94b41ae4bfe17c5b8c2e22527fd35 15:M 17 Mar 2022 22:57:16.508 Running mode=cluster, port=6379. 15:M 17 Mar 2022 22:57:16.508 # Server initialized 15:M 17 Mar 2022 22:57:16.512 Loading RDB produced by version 6.2.6 15:M 17 Mar 2022 22:57:16.512 RDB age 1178334 seconds 15:M 17 Mar 2022 22:57:16.512 RDB memory usage when created 8.17 Mb 15:M 17 Mar 2022 22:57:16.512 # Done loading RDB, keys loaded: 2, keys expired: 0. 15:M 17 Mar 2022 22:57:16.512 * DB loaded from disk: 0.003 seconds 15:M 17 Mar 2022 22:57:16.512 # I have keys for slot 11794, but the slot is assigned to another node. Setting it to importing state. 15:M 17 Mar 2022 22:57:16.512 # I have keys for slot 13796, but the slot is assigned to another node. Setting it to importing state.

sreenivasvp commented 2 years ago

@madolson @oranagra Please help on the same..

oranagra commented 2 years ago

@sreenivasvp on startup, redis loads data from the rdb file referred to by the dbfilename config, even if save is disabled. so maybe you just need to delete the file...

sreenivasvp commented 2 years ago

@oranagra The startup that I am referring to is master pod/node restarted on running cluster and that pod/node is comming back.

rdb is always read at boot only is it ??

oranagra commented 2 years ago

yes, rdb is always loaded at boot time if exists. and the only other place it can be loaded is when a replica connects to a master. please wait for @madolson to respond regarding the cluster configuration and importing state.

sreenivasvp commented 2 years ago

@oranagra The reason I asked rdb is always read at boot only is it ?? is : I was thinking, to delete the rdb file on each bootup irrespective of master/slave when it comes-up/starts back, so as to avoid issues from cluster getting corrupted / down.

Sure will wait for @madolson wrt cluster configuration and importing state.

sreenivasvp commented 2 years ago

@oranagra Any inputs on below please : Thinking, to delete the rdb file on each bootup irrespective of master/slave when it comes-up/starts back, so as to avoid issues from cluster getting corrupted / down.

markrity commented 1 year ago

I had the same issue, tried everything to make it stop writing to dump.rdb.

The solution was to use add to config file this line:

save ""

Worked like magic.

Also from what I have seen that problem happens only on version 6 and 7, on Redis 4 , it works without it, only commenting #save out disables the writes to dump.rdb .

Have not tested Redis 5.