[YSQL] ANALYZE <multiple-tables> commits kPlain transaction while DDL transaction is active #22353
Open
1 task done
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/bug
This issue is a bug
priority/medium
Medium priority issue
status/awaiting-triage
Issue awaiting triage
Jira Link: DB-11258
Description
From vanilla postgres comments in vacuum.c:
Thus the vanilla PG vacuum/analyze code attempts to commit any ongoing transaction that may have been active.
In YB, we begin a DDL transaction as part of the YBTxnDdlProcessUtility before entering into the vacuuming/analyzing code flow. This leads to
CommitTransaction
in pg_txn_manager.cc being called which ignores any active DDL transactions.This behavior might be unintentional and this assumption might lead to errors in the future.
To repro this issue, add the following check to pg_txn_manager.cc:
Status PgTxnManager::CommitPlainTransaction() { + SCHECK(!IsDdlMode(), InternalError, "Received DML txn commit with DDL txn state active"); return FinishPlainTransaction(Commit::kTrue); }
Run an ANALYZE command spanning multiple tables and observe the above error message:
ANALYZE <tbl1>, <tbl2>;
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: