提交 8283f748 编写于 作者: G Gang Xiong

When recovering in-doubt transactions, there were some transactions

missed due to incorrect iterating logic.
上级 d95f7dcc
......@@ -3194,7 +3194,7 @@ recoverInDoubtTransactions(void)
saved_currentGxact = currentGxact;
for (i = 0; i < *shmNumGxacts; i++)
for (i = 0; i < *shmNumGxacts; )
{
TMGXACT *gxact = shmGxactArray[i];
......@@ -3203,11 +3203,13 @@ recoverInDoubtTransactions(void)
*/
if (saved_currentGxact != NULL && gxact == saved_currentGxact)
{
i++;
continue;
}
else if (gxact->state == DTX_STATE_ACTIVE_NOT_DISTRIBUTED)
{
/* should take care of other sessions. */
i++;
continue;
}
......@@ -3246,6 +3248,9 @@ recoverInDoubtTransactions(void)
getTmLock();
/* This routine would call releaseGxact_UnderLocks, which
* would decrease *shmNumGxacts and do a swap, so no need
* to increase i */
doInsertForgetCommitted();
releaseTmLock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册