mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
Handle the case where create_link is replayed after crashing in the middle. In particular, if we restart when moving sstables from staging to the base dir, right after create_links completes, and right before deleting the source links, we end up with seemingly 2 valid sstables, one still in staging and the other already in the base table directory, both are hard linked to the same inodes. Make create_links idempotent so it can replay the operation safely if crashed and restarted at any point of its operation. Add unit tests for replay after partial create_links that is expected to succeed, and a test for replay when an sstable exist in the destination that is not hard-linked to the source sstable; create_links is expected to fail in this case. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>