Replibyte icon indicating copy to clipboard operation
Replibyte copied to clipboard

Wrong order when restoring dumps (>= 10 Chunks)

Open gugacavalieri opened this issue 3 years ago • 1 comments

There is a problem when restoring dumps that have more than 10 chunks. This happens because of the way Replibyte is generating the chunk names.

So here it's what happening when we have over 10 chunks:

Output chunks order when ordering by key:
1.dump
10.dump
11.dump
2.dump
3.dump 
...

So 10.dump and 11.dump gets restored before 2.dump and 3.dump because Replibyte it's not adding a trailing zero. For example: 02.dump < 10.dump but 10.dump < 2.dump.

This is preventing dumps from being restored.

I can provide a fix. Was thinking that something like that would solve the issue (Formatting the file name with always two digits) for S3 and local_disk:

let dump_file_path = format!("{}/{:02}.dump", dump_dir_path, file_part);

gugacavalieri avatar Nov 09 '22 16:11 gugacavalieri

Thanks for reporting this issue. I know why it happened and I can provide a fix (or.you can if you want)

evoxmusic avatar Nov 09 '22 17:11 evoxmusic