Transaction Guarantee, updated version

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Transaction Guarantee, updated version
Date: 2007-06-16 22:17:52
Message-ID: 1182032272.6855.17.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Completed all of the agreed changes for TG:
- WAL writer now runs always, wal_writer_delay = 50ms (default)
- when transaction_guarantee = off we record the latest LSN
- when we set xact hint bits we look at the latest LSN
- added database-level stats to show guaranteed commits
- fsync parameter still present
- removed logic in XLogInsert to test half-full wal buffers
- no DFC cache anymore
- retained LSN pass-down to mark clog to allow WAL-flush-before-write

Passed all of an afternoons testing with pgbench and make check.
make check passes with both settings of transaction_guarantee

Re-eyeballed every line of the patch to catch errors

Operating parameters are:
- transaction_guarantee = on | (off) [USERSET]
Normal transactions are guaranteed to have been written to disk before
we report COMMIT success back to the user. When the transaction
guarantee is relaxed we respond to the user that the transaction has
succeeded and defer the write to disk. The walwriter process will ensure
that any unguaranteed transactions are written to disk after at most two
cycles of the wal_writer_delay. This leaves a short window of data loss
that can occur should the database server crash.

- wal_writer_delay = 50ms (10-1000)

For debug, we have
- trace_commit = off | (on)
- trace_bg_flush = off | (on) - in this patch, defaults to **on**, but
this would be set back to off following review

More extensive docs required. Planning a whole new section to explain
why its OK and what it means etc., plus additional section in Perf Tips.
Code has good comments to explain things.

Logic to signal walwriter exists but is not now ever called. Seemed
worth keeping until review, at least.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
tg.v19.tar.gz application/x-compressed-tar 23.5 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-06-17 06:22:19 Re: Maintaining cluster order on insert
Previous Message Robert Treat 2007-06-16 20:56:58 Re: out of date url in developer faq