We serialized a RESTORE command for each entry into a string, and then push that string to the wire.
This means that, when serializing an entry of size X, we consume 2X memory during the migration.
This PR:
Instead of serializing into a string, we serialize into the wire directly. Luckily, only a small modification is needed in the way we interact with crc64, which works well even in chunks.
Before this PR:
We serialized a
RESTORE
command for each entry into a string, and then push that string to the wire. This means that, when serializing an entry of size X, we consume 2X memory during the migration.This PR:
Instead of serializing into a string, we serialize into the wire directly. Luckily, only a small modification is needed in the way we interact with
crc64
, which works well even in chunks.Fixes #4100