From 5eb15c9942a9bd6aaf712f2ab6175005e035168a Mon Sep 17 00:00:00 2001 From: Joe Conway Date: Sat, 11 Sep 2010 18:38:58 +0000 Subject: SERIALIZABLE transactions are actually implemented beneath the covers with transaction snapshots, i.e. a snapshot registered at the beginning of a transaction. Change variable naming and comments to reflect this reality in preparation for a future, truly serializable mode, e.g. Serializable Snapshot Isolation (SSI). For the moment transaction snapshots are still used to implement SERIALIZABLE, but hopefully not for too much longer. Patch by Kevin Grittner and Dan Ports with review and some minor wording changes by me. --- src/backend/executor/execMain.c | 4 ++-- src/backend/executor/nodeLockRows.c | 4 ++-- src/backend/executor/nodeModifyTable.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/backend/executor') diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 7dfb2ecbb6..f89f85d14c 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,7 +26,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.354 2010/08/05 14:45:02 rhaas Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.355 2010/09/11 18:38:56 joe Exp $ * *------------------------------------------------------------------------- */ @@ -1554,7 +1554,7 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, case HeapTupleUpdated: ReleaseBuffer(buffer); - if (IsXactIsoLevelSerializable) + if (IsolationUsesXactSnapshot()) ereport(ERROR, (errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), errmsg("could not serialize access due to concurrent update"))); diff --git a/src/backend/executor/nodeLockRows.c b/src/backend/executor/nodeLockRows.c index a84b64b095..fc0415a7a9 100644 --- a/src/backend/executor/nodeLockRows.c +++ b/src/backend/executor/nodeLockRows.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeLockRows.c,v 1.6 2010/07/28 17:21:56 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeLockRows.c,v 1.7 2010/09/11 18:38:56 joe Exp $ * *------------------------------------------------------------------------- */ @@ -130,7 +130,7 @@ lnext: break; case HeapTupleUpdated: - if (IsXactIsoLevelSerializable) + if (IsolationUsesXactSnapshot()) ereport(ERROR, (errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), errmsg("could not serialize access due to concurrent update"))); diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 65414b9267..86fc016b50 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeModifyTable.c,v 1.9 2010/08/18 21:52:24 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeModifyTable.c,v 1.10 2010/09/11 18:38:56 joe Exp $ * *------------------------------------------------------------------------- */ @@ -310,7 +310,7 @@ ExecDelete(ItemPointer tupleid, * Note: if es_crosscheck_snapshot isn't InvalidSnapshot, we check that * the row to be deleted is visible to that snapshot, and throw a can't- * serialize error if not. This is a special-case behavior needed for - * referential integrity updates in serializable transactions. + * referential integrity updates in transaction-snapshot mode transactions. */ ldelete:; result = heap_delete(resultRelationDesc, tupleid, @@ -328,7 +328,7 @@ ldelete:; break; case HeapTupleUpdated: - if (IsXactIsoLevelSerializable) + if (IsolationUsesXactSnapshot()) ereport(ERROR, (errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), errmsg("could not serialize access due to concurrent update"))); @@ -499,7 +499,7 @@ lreplace:; * Note: if es_crosscheck_snapshot isn't InvalidSnapshot, we check that * the row to be updated is visible to that snapshot, and throw a can't- * serialize error if not. This is a special-case behavior needed for - * referential integrity updates in serializable transactions. + * referential integrity updates in transaction-snapshot mode transactions. */ result = heap_update(resultRelationDesc, tupleid, tuple, &update_ctid, &update_xmax, @@ -516,7 +516,7 @@ lreplace:; break; case HeapTupleUpdated: - if (IsXactIsoLevelSerializable) + if (IsolationUsesXactSnapshot()) ereport(ERROR, (errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), errmsg("could not serialize access due to concurrent update"))); -- cgit v1.2.1