|
|
|
|
|
by koolba
453 days ago
|
|
You missed a number of steps. The transactions are independent so they signal completion (to trigger the commit fsync) independently. You can have the first transaction wait a bit to see if any other commits can be batched in the same fsync. However that’s off by default as the assumption is you want the transaction to complete as fast as possible. At least that’s how PostgreSQL implements it. |
|
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.