Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag for table access method to force exclusive write #969

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gfphoenix78
Copy link
Contributor

This commit adds a flag in table access method to force exclusive write. The feature allows writing of a table, i.e. insert/delete/ update, to be not concurrently safe.

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


This commit adds a flag in table access method to force exclusive
write. The feature allows writing of a table, i.e. insert/delete/
update, to be not concurrently safe.
if (resultRelInfo->ri_RelationDesc->rd_tableam &&
(table_scan_flags(resultRelInfo->ri_RelationDesc) & SCAN_FORCE_BIG_WRITE_LOCK))
{
LockRelation(resultRelInfo->ri_RelationDesc, ExclusiveLock);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, when will unlock happen?

@yjhjstz
Copy link
Member

yjhjstz commented Feb 27, 2025

what's scenario need ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants