mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 20:00:00 +00:00
Fix crash in active defrag (#883)
This crash would happen if we disable active defrag while it is running, then re-enable active defrag. In this case the `expires_cursor` variable in `activeDefragCycle()` would not be reset to 0 when disabling active defrag, so when re-enabling it, this variable can still be non-zero, which causes the `db` and other variables to not be initialized before starting the defrag process. Signed-off-by: Pierre Turin <pieturin@amazon.com>
This commit is contained in:
parent
579cca5f00
commit
68d887636e
@ -941,6 +941,7 @@ void activeDefragCycle(void) {
|
|||||||
defrag_later_cursor = 0;
|
defrag_later_cursor = 0;
|
||||||
current_db = -1;
|
current_db = -1;
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
|
expires_cursor = 0;
|
||||||
db = NULL;
|
db = NULL;
|
||||||
goto update_metrics;
|
goto update_metrics;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user