mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-25 11:00:35 +00:00
The solution was proposed by Nadav. When writing a new sstable, write all usual files, write the TOC to a temporary file, and then rename it, which is atomic. Files not belonging to any TOC are invalid, so we ensure that partially written sstables aren't reused. Avi also proposed using fsync on the sstable directory to guarantee that the files reached the disk before sealing the sstable. Subsequently, we should add code to avoid loading sstable which TOC is either temporary or doesn't exist. Temporary TOC files should also be deleted. Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>