Skip to content

2.27.0.0-b622

@kai-franz kai-franz tagged this 30 Sep 16:35
Summary:
Currently, as an optimization, we do not increment the catalog version for the following DDL commands:

  - `CREATE OPERATOR`
  - `CREATE AGGREGATE`
  - `CREATE TYPE`
  - `CREATE TEXT SEARCH ...`
  - `CREATE COLLATION`
  - `COMMENT`
  - `CREATE PROFILE`
  - `TRUNCATE` (when `yb_enable_alter_table_rewrite=false`)
  - `CREATE VIEW`
  - `CREATE ROLE` (when not referencing other roles)
  - `CREATE TABLE`
  - `CREATE TABLE AS`
  - `CREATE SEQUENCE`
  - `DISCARD`
  - `DROP` (on temp objects)
  - `ALTER TABLE` on temp tables
  - `CREATE INDEX` on temp tables
  - `ALTER ROLE WITH PASSWORD`

This diff adds a GUC, `yb_make_all_ddl_statements_incrementing`, that, when enabled, modifies the logic in `YbGetDdlMode` to increment the catalog version for the aforementioned DDLs. By default, this GUC is disabled, so the default behavior is unchanged.

This will allow us to turn on negative caching in the future when `yb_make_all_ddl_statements_incrementing=true`.

NOTE: Even though the catalog version bump has been disabled in `YbGetDdlMode`, we do a final check in `YBCommitTransactionContainingDDL` where we don't bump the catalog version if PG didn't generate any invalidation messages for the current DDL. So even with `yb_make_all_ddl_statements_incrementing` enabled, there are some DDLS where we still ultimately choose not to bump the catalog version.
Jira: DB-17924

Test Plan:
```
./yb_build.sh release --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscIndependent'
```

Reviewers: myang, sanketh

Reviewed By: myang

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D46348
Assets 2
Loading