Hot Standby: Relation-specific deferred conflict resolution

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Hot Standby: Relation-specific deferred conflict resolution
Date: 2010-01-28 21:49:22
Message-ID: 1264715363.24669.12324.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Conflict resolution improvements are important to include in this
release, as discussed many times. Proposal given here
http://archives.postgresql.org/pgsql-hackers/2009-12/msg01175.php
presents a viable design to improve this.

Following patch is a complete working implementation of that design.
I'm still testing it, but its worth publishing as early as possible to
allow discussion. Not for commit, just yet, but soon.

standby.c changes are to decide whether to defer recovery based upon
relfilenode of WAL record. If resolution deferred, re-check for conflict
during LockAcquire() and fail with snapshot error, just as if resolution
had never been deferred. Also, an optimisation of conflict processing to
avoid continual re-evaluation of conflicts since some are now deferred.

API changes in heapam and nbtxlog to pass thru RelFileNode
API changes in indexcmds, no behaviour changes
procarray changes to implement LatestRemovedXid cache

backend/access/heap/heapam.c | 6 -
backend/access/nbtree/nbtxlog.c | 2
backend/commands/indexcmds.c | 4 -
backend/storage/ipc/procarray.c | 55 +++++++++++-
backend/storage/ipc/standby.c | 112 +++++++++++++++++++++++------
backend/storage/lmgr/lock.c | 124 ++++++++++++++++++++++++++++++--
include/storage/lock.h | 8 ++
include/storage/proc.h | 5 +
include/storage/standby.h | 9 ++
9 files changed, 292 insertions(+), 33 deletions(-)

--
Simon Riggs www.2ndQuadrant.com

Attachment Content-Type Size
relation_specific_conflict_resolution.patch text/x-patch 26.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Glaesemann 2010-01-28 22:14:04 Pathological regexp match
Previous Message Mike Rylander 2010-01-28 21:44:28 Re: remove contrib/xml2