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] Batch nested loops closing connection when querying information_schema table due to invalid cumulative relations when getting batched clauses #15878

Closed
mislam-yb opened this issue Jan 30, 2023 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@mislam-yb
Copy link
Contributor

mislam-yb commented Jan 30, 2023

Jira Link: DB-5284

Description

When using batched nested loops, queries to information_schema cause the connection to close due to the following error seen on the postgres logs:

TRAP: FailedAssertion("!(!bms_overlap(cur_relgroup, cumulative_rels))", File: "../../../../../../../src/postgres/src/backend/optimizer/util/restrictinfo.c", Line: 519)

This error occured for the latest debug build for 2.17.2.0, and was reproduced by @tanujnay112.

Reproduction:

set yb_bnl_batch_size = 1;
select table_name, table_schema from information_schema.tables;
-- works fine

set yb_bnl_batch_size = 2;
select table_name, table_schema from information_schema.tables;
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
@mislam-yb mislam-yb added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Jan 30, 2023
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue and removed status/awaiting-triage Issue awaiting triage labels Jan 30, 2023
tanujnay112 added a commit that referenced this issue Jan 30, 2023
Summary: 12e23ad introduced the concept of yb_availBatchedRelids in the PlannerRoot structure. This field is meant to be added to in the creation of a batched nested loop join node in order for its inner side to use it. It should be restored to its original state after the inner side is built and this change corrects that.

Test Plan: ./yb_build.sh release --java-test 'org.yb.pgsql.TestPgRegressJoin'

Reviewers: mtakahara

Reviewed By: mtakahara

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D22583
@mislam-yb mislam-yb reopened this Feb 7, 2023
@mislam-yb mislam-yb changed the title [YSQL] Batch nested loops closing connection when querying information_schema table [YSQL] Batch nested loops closing connection when querying information_schema table due to invalid cumulative relations when getting batched clauses Feb 16, 2023
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
None yet
Development

No branches or pull requests

3 participants