|
|
|
|
|
by jiggawatts
453 days ago
|
|
The clever way to do this is to immediately commit the first transaction when the storage engine is idle. While it is waiting for the fsync to finish it should batch up any incoming WAL writes and then issue the next fsync immediately after the first one finishes, committing the entire batch at once. Then, and only then, it can reply to clients with “transaction complete”. Some modern database engines now do this, by many older ones don’t because too much of their code assumes one transaction per fsync. |
|
There’s also concurrency issues with writing and fsyncing the same fd: http://oldblog.antirez.com/post/fsync-different-thread-usele...