Merge pull request #143 from MasahikoSawada/fix_lock_exclusive

Reset the transcation state before exiting from lock_exclusive.
This commit is contained in:
Masahiko Sawada 2017-08-24 09:20:08 +09:00 committed by GitHub
commit b2d470a122

View File

@ -1780,6 +1780,12 @@ lock_exclusive(PGconn *conn, const char *relid, const char *lock_query, bool sta
{
elog(WARNING, "timed out, do not cancel conflicting backends");
ret = false;
/* Before exit the loop reset the transaction */
if (start_xact)
pgut_rollback(conn);
else
pgut_command(conn, "ROLLBACK TO SAVEPOINT repack_sp1", 0, NULL);
break;
}
else