0

https://www.postgresql.org/docs/current/static/standby-settings.html

The delay occurs only on WAL records for transaction commits. Other records are replayed as quickly as possible, which is not a problem because MVCC visibility rules ensure their effects are not visible until the corresponding commit record is applied.

I thought while streaming replication xlog is replayed on slave. Local transactions are not replayed. Remote statements that skip WAL (Eg create table nologging) are not replayed on slave. Now I'm confused - what are those other records that are replayed not waiting for recovery_min_apply_delay?..

  • 1
    The pass you quoted tells exactly this: 'transaction commits'. So the changes that are made are replayed, but not the commit - effectively meaning that the changed data is already sitting there waiting to go 'live' when the commit itself is replayed. – dezso Mar 30 '17 at 9:17
  • Ah! I thought it was my bad English - the the WAL is replayed, not committing transactions from it until recovery_min_apply_delay expires for that transaction? – Vao Tsun Mar 30 '17 at 9:20
2

There are lots of transaction log records other than commits.

Transaction ID allocations (roughly like a BEGIN delayed until first actual write). Inserts, updates, deletes, vacuum, lots of internal operations.

Synchronous streaming replication only waits for confirmation that the replica has replayed commit transaction log records. Not any of the others.

Some things, like the UNLOGGED tables you refer to, do not generate any transaction logs at all. So they cannot affect replicas. But that is not what that passage in the docs is talking about.

  • yes- thank you. @dezso already explained that to me. My bad English is the reason to misunderstand docs. If it would say The delay on WAL records occurs only for transaction commits instead - I would not ask silly questions. – Vao Tsun Mar 30 '17 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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