diff options
author | Michael P | 2012-04-10 01:06:29 +0000 |
---|---|---|
committer | Michael P | 2012-04-10 01:07:03 +0000 |
commit | 79efd8faf958947b1509e814b4dc87faae28706e (patch) | |
tree | 83934d0f096b774c6dd978991a98a0f8105a2b8d /src/backend/executor/nodeModifyTable.c | |
parent | ce001733b43f9e76e6554ffea21fb35385e34db4 (diff) |
Addition of integer node identifier as part of tuple information
This mechanism permits to identify uniquely a tuple fetched from
Datanode on Coordinator by adding to the tuple information a field
called xc_node_id which is used as a unique node integer identifier.
This node ID is calculated at node creation and added in tuple information
as a kind of extension of ctid. It can be used in internal XC mechanisms.
This commit also includes a fix for round robin tables using remote update
and delete plans. This was an old issue that remained in the test xc_remote but
there was no way until now to identify the node origin of a tuple with a method
which is tuple-based.
Original feature is from Abbas.
The fix regarding round robin tables is from me. I also did some cleanup and
documentation addition on the new column of pgxc_node.
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
-rw-r--r-- | src/backend/executor/nodeModifyTable.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 0cf693aec4..002e1d2991 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -351,6 +351,9 @@ ExecDelete(ItemPointer tupleid, tuple.t_len = HeapTupleHeaderGetDatumLength(oldtuple); ItemPointerSetInvalid(&(tuple.t_self)); tuple.t_tableOid = InvalidOid; +#ifdef PGXC + tuple.t_xc_node_id = 0; +#endif dodelete = ExecIRDeleteTriggers(estate, resultRelInfo, &tuple); @@ -464,6 +467,9 @@ ldelete:; deltuple.t_len = HeapTupleHeaderGetDatumLength(oldtuple); ItemPointerSetInvalid(&(deltuple.t_self)); deltuple.t_tableOid = InvalidOid; +#ifdef PGXC + deltuple.t_xc_node_id = 0; +#endif delbuffer = InvalidBuffer; } else @@ -575,6 +581,9 @@ ExecUpdate(ItemPointer tupleid, oldtup.t_len = HeapTupleHeaderGetDatumLength(oldtuple); ItemPointerSetInvalid(&(oldtup.t_self)); oldtup.t_tableOid = InvalidOid; +#ifdef PGXC + oldtup.t_xc_node_id = 0; +#endif slot = ExecIRUpdateTriggers(estate, resultRelInfo, &oldtup, slot); |