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] Sample wait events before inserting them in the circular buffer #21751

Closed
1 task done
abhinab-yb opened this issue Apr 1, 2024 · 0 comments
Closed
1 task done
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 Apr 1, 2024

Jira Link: DB-10625

Description

Currently, all the wait events from YSQL, YCQL and TServer are inserted into the circular buffer. These should be sampled based on the gflag ysql_yb_ash_sample_size

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 area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Apr 1, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Apr 1, 2024
@abhinab-yb abhinab-yb self-assigned this Apr 1, 2024
@abhinab-yb abhinab-yb added area/active-history Active history of sessions and removed kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage labels Apr 1, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue and removed area/active-history Active history of sessions labels Apr 1, 2024
abhinab-yb added a commit that referenced this issue Jul 2, 2024
Summary:
This diff implements sampling of wait events based on the reservoir
sampling algorithm (https://en.wikipedia.org/wiki/Reservoir_sampling)

We take random `ysql_yb_ash_sample_size` number of events from
each component - YSQL, YCQL and TServer.

When inserting YSQL samples into the circular buffer, we don't know the
the actual number of valid samples, so we cannot calculate the sample
weight. So, after inserting all the samples in the circular buffer, we go back
and update the sample weight of all the recently inserted samples.

The fields flush_and_compaction_wait_states and raft_log_appender_wait_states
in PgActiveSessionHistoryResponsePB are deprecated and the background wait
states are now part of tserver_wait_states

The datatype of sample_weight in ybc_pg_typedefs.h is updated to float which is
used is all other places.

Upgrade/Rollback safety: The updated protobuf is only for pg to local tserver
communication.
Jira: DB-10625

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

Reviewers: jason, amitanand

Reviewed By: jason, amitanand

Subscribers: yql, hbhanawat, ybase

Differential Revision: https://phorge.dev.yugabyte.com/D35804
jasonyb pushed a commit that referenced this issue Jul 2, 2024
Summary:
 f8e73e9 [#18192] YSQL: Introduce interface to mock tserver response in MiniCluster tests
 4ae68f4 Build break fix for centos7
 Excluded: 2ec9224 [#23033] Allow running YSQL upgrade unit tests with snapshot other than 2.0.9.0
 37912f1 [#22058] docdb: Disable connections on cloned db until cloning is complete
 059b855 [#22908] xCluster: Use XClusterRemoteClient across XCluster
 5dc5ee7 [#22849] YSQL: Correctly handle reset phase timeout errors in YSQL Connection Manager
 af49a1e [#22876][#22835][#22773] CDCSDK: Add new auto flag to identify non-eligible tables in CDC stream
 f3c4e14 [PLAT-14524] Up-version pekko to fix TLSActor infinite loop
 9388aea [#23052] yugabyted:  Restarting a node fails when data_dir is missing in user specified configuration.
 5cf9736 [PLAT-12685]: Generate a YBA metric for xcluster config table status.
 73fc90a [PLAT-14497]: Fix incremental backup time when none full backup exists
 e9b5ba5 [PLAT-14533]: Modify the gflags metadata support db version check
 8dca952 [PLAT-14432][Platform] Show certificate Database Node Certificate/key and Client Certificate/key for CA certs in certificate details modal
 6551e45 Add utkarsh.munjal to contributors.md
 bafa1cb [#21751] YSQL, ASH: Sampling of wait events

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: jason, tfoucher

Subscribers: yql

Tags: #jenkins-ready

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