Skip to content

[YSQL] Consider removing retry for cache refresh when object locking is enabled #30376

@iSignal

Description

@iSignal

Jira Link: DB-20259

Description

In

YBPrepareCacheRefreshIfNeeded(edata,
we retry schema version mismatch if updating the cache to a newer catalog version might help fix the issue. Schema version mismatches should be rare with object locking enabled, so we could consider disabling this path.

One place where a schema version mismatch is expected is

begin
alter table foo add column x
rollback

In this case, the docdb schema version may change on the rollback without a corresponding PG catalog version change so retrying here would presumably help due to the lines below

	else if (need_table_cache_refresh)
	{
		ereport(LOG,
				(errmsg("invalidating table cache entry %s",
						table_to_refresh)));
		HandleYBStatus(YBCPgInvalidateTableCacheByTableId(table_to_refresh));

So it may be possible to just disable the global version check in this case.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions