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

[YSQL] Deferred FK trigger performs read at wrong time #25431

Open
1 task done
d-uspenskiy opened this issue Dec 25, 2024 · 0 comments
Open
1 task done

[YSQL] Deferred FK trigger performs read at wrong time #25431

d-uspenskiy opened this issue Dec 25, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@d-uspenskiy
Copy link
Contributor

d-uspenskiy commented Dec 25, 2024

Jira Link: DB-14665

Description

The following unit test fails in case the FLAGS_TEST_ysql_ignore_add_fk_reference flag is set to true

TEST_F_EX(PgFKeyTest, DeferredConstraintReadAtTxnEnd, PgFKeyTestNoFKCache) {
  auto conn = ASSERT_RESULT(Connect());
  ASSERT_OK(conn.Execute("CREATE TABLE pk_t(k INT, PRIMARY KEY (k ASC))"));
  ASSERT_OK(conn.Execute(
      "CREATE TABLE fk_t(k INT, pk_1 INT REFERENCES pk_t(k), "
      "pk_2 INT REFERENCES pk_t(k) DEFERRABLE INITIALLY DEFERRED, PRIMARY KEY (k ASC))"));
  ASSERT_OK(conn.Execute("INSERT INTO pk_t VALUES (1)"));
  ASSERT_OK(conn.StartTransaction(IsolationLevel::SNAPSHOT_ISOLATION));
  ASSERT_OK(conn.Execute("INSERT INTO fk_t VALUES(1, 1, 2)"));
  ASSERT_OK(conn.Execute("INSERT INTO pk_t VALUES(2)"));
  ASSERT_OK(conn.CommitTransaction());
}

This behavior may lead to undesired transaction conflicts.

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.
@d-uspenskiy d-uspenskiy added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Dec 25, 2024
@d-uspenskiy d-uspenskiy self-assigned this Dec 25, 2024
@d-uspenskiy d-uspenskiy added this to YSQL Dec 25, 2024
@github-project-automation github-project-automation bot moved this to Backlog in YSQL Dec 25, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Dec 25, 2024
@sushantrmishra sushantrmishra removed the status/awaiting-triage Issue awaiting triage label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue
Projects
Status: Backlog
Development

No branches or pull requests

3 participants