3 ms·
Each table has transaction file (_txn). This file has navigation pointers for both reader and writer. We map this file into memory and read and write this memor
by bluestreak 7y ago
Each table has transaction file (_txn). This file has navigation pointers for both reader and writer. We map this file into memory and read and write this memory atomically without blocking. Data that is written but not referred to from _txn is ignored by reader. On other hand _txn writer related information has "todo" list that is populated before writer attempts structure changes or truncate. When something writer does fails, it will attempt to undo that. When undo also fails it will report error and will re-attempt repair on restart.
A good example of that would be deleting a column or partition on Windows. Writer will communicate to reader via _txn file that structure version is changed and attempt to delete files via todo system. So reader will pick up such change even if writer fails to delete files. Hope this all makes sense!