Skip to content

2.25.0.0-b395

@abhinab-yb abhinab-yb tagged this 29 Nov 04:58
Summary:
This diff adds support for sampling YSQL background workers.

Summary of changes -
- Add a new const query id for YSQL background workers
- While deciding whether to consider a backend for sampling or not, we now only check for `MyProc->yb_is_ash_metadata_set`
- The CPU wait event name in YSQL is changed from `QueryProcessing` to `OnCpu_Active` because now we also have background workers which may not be executing queries
- We no longer take locks while setting root_request_id, client_node_ip, pid, more details in code comments
- We don't sample the ASH collector itself because it will always show CPU events
- kQueryIdForCatalogRequests is renamed to kQueryIdForUncomputedQueryId as this is more accurate name
- Two sync RPCs CronGetLastMinute and CronSetLastMinute called from the pg_cron background worker are now also instrumented

**Upgrade/Rollback safety:** Safe to upgrade/rollback, if ASH metadata
is not found in the PB, then metadata in the threadlocal wait state object
is not updated.

If ASH metadata is sent, and the other tserver is still on old version, it will
simply ignore and continue doing it's work
Jira: DB-12805

Test Plan:
./yb_build.sh --cxx-test pg_ash-test --gtest_filter PgBgWorkersTest.ValidateBgWorkers
./yb_build.sh --cxx-test pg_ash-test --gtest_filter PgWaitEventAuxTest.PgCronRPCs

Reviewers: hsunder

Reviewed By: hsunder

Subscribers: smishra, yql, ybase

Differential Revision: https://phorge.dev.yugabyte.com/D39062
Assets 2
Loading