Re: Inconsistent update in the MERGE command
От | Chao Li |
---|---|
Тема | Re: Inconsistent update in the MERGE command |
Дата | |
Msg-id | 9CBB705C-7AC9-4724-9CB3-E5C09AB69ECF@gmail.com обсуждение исходный текст |
Ответ на | Re: Inconsistent update in the MERGE command (Yugo Nagata <nagata@sraoss.co.jp>) |
Список | pgsql-hackers |
On Aug 25, 2025, at 01:34, Yugo Nagata <nagata@sraoss.co.jp> wrote:Currently, TM_FailureData.ctid is used as a reference to the
latest version of oldtuple, but this is not always correct.
Instead, the tupleid passed to table_tuple_lock should be used.
At line 3386:
result = table_tuple_lock(resultRelationDesc, tupleid,
estate->es_snapshot,
inputslot, estate->es_output_cid,
lockmode, LockWaitBlock,
TUPLE_LOCK_FLAG_FIND_LAST_VERSION,
&context->tmfd);
When calling table_tuple_lock(), “tupleid” is used to lock the tuple, and “&context->tmfd” is used to carry out lasted version of tuple info if table_tuple_lock() fails.
In this case, at line 3394, it drops into:
switch (result)
{
case TM_Ok:
Result is TM_Ok, meaning table_tuple_lock() didn’t fail, then we should not use info from “context->tmfd”.
So I think this fix makes sense.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
HighGo Software Co., Ltd.
https://www.highgo.com/
В списке pgsql-hackers по дате отправления: