diff options
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r-- | src/backend/access/heap/heapam.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 1ea78ec8633..39f6d223ebd 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.43 1999/05/25 16:07:04 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.44 1999/06/10 14:17:05 vadim Exp $ * * * INTERFACE ROUTINES @@ -1152,8 +1152,13 @@ l1: LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE); if (TransactionIdDidAbort(xwait)) goto l1; - /* concurrent xact committed */ - Assert(tp.t_data->t_xmax == xwait); + /* + * xwait is committed but if xwait had just marked + * the tuple for update then some other xaction could + * update this tuple before we got to this point. + */ + if (tp.t_data->t_xmax != xwait) + goto l1; if (!(tp.t_data->t_infomask & HEAP_XMAX_COMMITTED)) { tp.t_data->t_infomask |= HEAP_XMAX_COMMITTED; @@ -1242,8 +1247,13 @@ l2: LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE); if (TransactionIdDidAbort(xwait)) goto l2; - /* concurrent xact committed */ - Assert(oldtup.t_data->t_xmax == xwait); + /* + * xwait is committed but if xwait had just marked + * the tuple for update then some other xaction could + * update this tuple before we got to this point. + */ + if (oldtup.t_data->t_xmax != xwait) + goto l2; if (!(oldtup.t_data->t_infomask & HEAP_XMAX_COMMITTED)) { oldtup.t_data->t_infomask |= HEAP_XMAX_COMMITTED; @@ -1359,8 +1369,13 @@ l3: LockBuffer(*buffer, BUFFER_LOCK_EXCLUSIVE); if (TransactionIdDidAbort(xwait)) goto l3; - /* concurrent xact committed */ - Assert(tuple->t_data->t_xmax == xwait); + /* + * xwait is committed but if xwait had just marked + * the tuple for update then some other xaction could + * update this tuple before we got to this point. + */ + if (tuple->t_data->t_xmax != xwait) + goto l3; if (!(tuple->t_data->t_infomask & HEAP_XMAX_COMMITTED)) { tuple->t_data->t_infomask |= HEAP_XMAX_COMMITTED; |