Skip to content

2.27.0.0-b432

@abhinab-yb abhinab-yb tagged this 11 Aug 02:49
Summary:
This diff instruments the tserver side of CDC.

Query id 11 is given to the walsender proceess
to distinguish it's events.

One new wait event WAL_Read is added, which
captures the wait happening while reading WAL.

The walsender process also does `select()`
system calls. For this, another wait event
`YbIdleSleep` is added. This wait will never
be seen in ASH as this is a idle wait event,
so sampling will be skipped when the wait
event is set to this. This is fine because
`select()` doesn't consume CPU cycles.

Here is a sample out of the events -

```
SELECT
    ash.query_id,
    ash.wait_event_component,
    ash.wait_event,
    ash.wait_event_type,
    ash.wait_event_aux,
    COUNT(*)
FROM
    yb_active_session_history ash
WHERE
    ash.query_id = 11
GROUP BY
    ash.query_id,
    ash.wait_event_component,
    ash.wait_event,
    ash.wait_event_type,
    ash.wait_event_aux
ORDER BY
    ash.query_id,
    ash.wait_event_component,
    ash.wait_event_type;

 query_id | wait_event_component |         wait_event          | wait_event_type |    wait_event_aux    | count
----------+----------------------+-----------------------------+-----------------+----------------------+-------
       11 | TServer              | OnCpu_Active                | Cpu             |                      |   477
       11 | TServer              | OnCpu_Passive               | Cpu             |                      |    12
       11 | TServer              | WAL_Read                    | DiskIO          |                      |    22
       11 | TServer              | MVCC_WaitForSafeTime        | WaitOnCondition |                      |     2
       11 | TServer              | ReplicaState_TakeUpdateLock | WaitOnCondition |                      |     3
       11 | TServer              | WaitForReadTime             | WaitOnCondition |                      |     1
       11 | YSQL                 | OnCpu_Active                | Cpu             |                      |    74
       11 | YSQL                 | WaitingOnTServer            | RPCWait         | GetConsistentChanges |   358
```
Jira: DB-12142

Test Plan: ./yb_build.sh --cxx-test wait_states-itest --gtest_filter WaitStateITest/AshTestVerifyOccurrence.VerifyWaitStateEntered/kWAL_Read

Reviewers: skumar, amitanand, sumukh.phalgaonkar

Reviewed By: amitanand, sumukh.phalgaonkar

Subscribers: yql

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