Skip to content

Commit 8c72130

Browse files
committed
[#30367] YSQL: Log before invalidating table cache after ALTER TABLE
Summary: When a transaction executes an ALTER TABLE operation, we remember the table id in ddl_transaction_state.altered_table_ids and upon COMMIT, we invalidate the table cache of such tables. We are investigating a "schema version mismatch" error (linked bug) which executes an ALTER TABLE post TRUNCATE. Add log to aid the investigation. Note that since DDLs are not that frequent, this log can be at INFO level. Test Plan: Jenkins: compile only Just adds a log, so no need to run the tests. I've run the transactional ddl test locally. Reviewers: myang, fizaa Reviewed By: fizaa Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D50670
1 parent 53176d2 commit 8c72130

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/postgres/src/backend/utils/misc/pg_yb_utils.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4507,6 +4507,9 @@ YbInvalidateTableCacheForAlteredTables()
45074507
YbDatabaseAndRelfileNodeOid *object_id =
45084508
(YbDatabaseAndRelfileNodeOid *) lfirst(lc);
45094509

4510+
YBC_LOG_INFO("Invalidating table cache entry for table %u:%u",
4511+
object_id->database_oid, object_id->relfilenode_id);
4512+
45104513
/*
45114514
* This is safe to do even for tables which don't exist or have
45124515
* already been invalidated because this is just a deletion/marking

0 commit comments

Comments
 (0)