Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#24958] DocDB: Fix pg_locks test TestWaitStartTimeIsConsistentAcross…
…WaiterReEntries Summary: Test `PgGetLockStatusTest.TestWaitStartTimeIsConsistentAcrossWaiterReEntries` relied on sleeps in the test to assert that wait start time of waiter requests remains the same upon re-entries of the request to the wait-queue. The same rpc request could re-enter the wait-queue in the following ways: 1. Waiter is resumed, re-does conflict resolution, finds new blocker(s), enters the queue again 2. Waiter request times out in the wait-queue (30s default), callback is invoked with Timeout status, the host tserver retries the rpc if it is well within the deadline, and the request re-enters the wait-queue. The revision re-constructs the test by introducing a sync point for better synchronization. Additionally, it has one other change - previously, the wait start time during conflict resolution was being set prior to the request entering the wait-queue. The diff modifies this by setting the wait start time post the request enters the wait-queue (this is consistent with the logic that we have in `TryPreWait`). Note that the wait start time field is only used for incrementing the metric `tablet::TabletEventStats::kTotalWaitQueueTime`. Jira: DB-14094 Test Plan: Jenkins ./yb_build.sh fastdebug --cxx-test='TEST_F(PgGetLockStatusTest, TestWaitStartTimeIsConsistentAcrossWaiterReEntries) {' -n 50 --tp 1 Reviewers: pjain, patnaik.balivada Reviewed By: patnaik.balivada Subscribers: yql, ybase Differential Revision: https://phorge.dev.yugabyte.com/D40062
- Loading branch information