Commit 5cd3998
committed
[yugabyte#24958] DocDB: Fix pg_locks test TestWaitStartTimeIsConsistentAcrossWaiterReEntries
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/D400621 parent b426a72 commit 5cd3998
File tree
2 files changed
+27
-8
lines changed- src/yb
- docdb
- yql/pgwrapper
2 files changed
+27
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
| |||
705 | 706 | | |
706 | 707 | | |
707 | 708 | | |
708 | | - | |
709 | | - | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
715 | 717 | | |
716 | 718 | | |
717 | 719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
782 | 783 | | |
783 | 784 | | |
784 | | - | |
785 | | - | |
| 785 | + | |
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
794 | 803 | | |
795 | 804 | | |
796 | 805 | | |
| |||
806 | 815 | | |
807 | 816 | | |
808 | 817 | | |
809 | | - | |
810 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
811 | 824 | | |
812 | 825 | | |
813 | 826 | | |
| |||
823 | 836 | | |
824 | 837 | | |
825 | 838 | | |
826 | | - | |
827 | | - | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
828 | 844 | | |
829 | 845 | | |
830 | 846 | | |
| |||
833 | 849 | | |
834 | 850 | | |
835 | 851 | | |
| 852 | + | |
836 | 853 | | |
837 | 854 | | |
838 | 855 | | |
| |||
0 commit comments