0

I know the transaction can ensure that all the queries are committed or rolled back, but what is the point at which we can say ok, the transaction has been committed and all changes are durable? I think it is when commit flag is written into redo log (take mysql as an example), is it right?

1 Answer 1

1

For all intense and purposes, the transaction is commit - then commit statement is complete. At that point all changes are durable and will survive reboot even if the data is technically still in "dirty pages" and not in the table's pages.

When dirty pages become white? That depends on the RDBMS and each one has a lengthy discussion in documentation about this. For MySQL the rules for this are described here: https://dev.mysql.com/doc/refman/8.0/en/innodb-buffer-pool-flushing.html

2
  • Good answer, but it applies to a single (non-replicated) server. Old replication is async. Semi-sync is well,... Galera involves the gcache. Etc. In those situations, then "maybe".
    – Rick James
    Commented Dec 27, 2023 at 23:31
  • But there is another problem: when can we say commit statement is complete from mysql server's view? Notice: I know it is hard from client's view, but i think it is a determinate action for server, after executing a certain c++ statement for example.
    – Kaiyu Yang
    Commented Dec 28, 2023 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.