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][ASH] Query id is never popped from the nested query id stack #24095

Closed
1 task done
abhinab-yb opened this issue Sep 23, 2024 · 0 comments
Closed
1 task done

[YSQL][ASH] Query id is never popped from the nested query id stack #24095

abhinab-yb opened this issue Sep 23, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@abhinab-yb
Copy link
Contributor

abhinab-yb commented Sep 23, 2024

Jira Link: DB-12988

Description

adf3c54 updated the way how query id was being popped from the nested query id stack, and there was a bug in the code which caused the query ids to never be popped because of a mismatch between the actual query id and expected query id to be popped

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.
@abhinab-yb abhinab-yb added the area/ysql Yugabyte SQL (YSQL) label Sep 23, 2024
@abhinab-yb abhinab-yb self-assigned this Sep 23, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Sep 23, 2024
abhinab-yb added a commit that referenced this issue Oct 1, 2024
Summary:
D36801 / adf3c54 updated the way how
query id is being popped from the nested query id stack. There was a
bug in the previous workflow -

- Once a new query id comes, push the current query id to the stack and set the current query id to the new query id.
- When popping, the current query id is checked, if it matches the top of the stack, then we pop it.

However, this is incorrect as we never pushed the current query id to
the stack so when we are trying to pop, we will never get a match of the
query id. This would result in the wait events being tracked by incorrect
query ids if `pg_stat_statements.track="all"` was turned on and user
fired nested queries.

This diff fixes this by also pushing the current query id to the stack.

This also fixes a out of bounds error while accessing `query_id_stack.query_ids`
Jira: DB-12988

Test Plan:
./yb_build.sh --java-test TestYbAsh#testNestedQueriesWithAsh

Manually tested by logging the query id while pushing and popping and made sure they are the same

Reviewers: jason

Reviewed By: jason

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D38316
timothy-e pushed a commit that referenced this issue Oct 1, 2024
Summary:
 dee9b98 Add Read Committed transaction isolation level (#24189)
 0ae2e65 [#23309] YSQL: Port pg_partman tests
 f410277 [PLAT-14846] Add pause/resume dr config along with associated universes workflow
 c59aee6 [docs] Added Release notes for 2.20.7.0 (#24140)
 792ea9f [PLAT-14679] Update algorithm to calculate clock skew from chrony
 fc70d35 [PLAT-15352] Upgrade postgres version in YBA installer
 a426ff7 [#24124] YSQL: Fix left over index that is not garbage collected
 c84942d [#24158] docdb: Enable clone parameter for PgsqlDropUniqueConstraint test
 f38cc07 [PLAT-15483] Fix Replica count logic to work with older k8s cluster where availableReplicas are not present
 4f53e36 [PLAT-15496] Handle throwable in TaskExecutor
 Excluded: e357c7c [#22327] YSQL, ASH: Instrument reads and writes from files and programs during COPY
 56ae3b6 [#24095] YSQL, ASH: Fix query id not popping from nested query stack

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: tfoucher, fizaa, telgersma

Differential Revision: https://phorge.dev.yugabyte.com/D38586
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

2 participants