dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.47k stars 926 forks source link

Infinite dump process if --save-schedule flag is enabled #1671

Closed michail-vestnik closed 1 year ago

michail-vestnik commented 1 year ago

HI!

I am running dragonfly with the following flags:

dragonfly --logtostderr --bind localhost --port 6379 --maxmemory 12gb --save_schedule "*:30" --dir storage 2>> dragonfly.log

Then I send a SIGTINT signal. This signal is sent to the program when, for example, we press ctrl + c in the terminal. Redis writes a dump and exits. but dragonfly starts an endless data dump process! if this flag is removed (--save-schedule) - the program works correctly.

I also have a question:

Dumps are not overwritten as they default to a timestamped name. This means, for example, 4 dump files are saved every hour. In 30 days there will be 2880 files of different sizes. This can lead to a shortage of disk space. What do you think?

Environment (please complete the following information):

chakaz commented 1 year ago

The failure to exit the process was fixed in https://github.com/dragonflydb/dragonfly/pull/1647, stay tuned for an upcoming release which should include it. Re/ overwrites - you could specify a pattern (via --dbfilename) which does not include timestamps, in which case Dragonfly will overwrite the existing files.

chakaz commented 1 year ago

Please reopen if I missed anything!