[DocDB] Select statement may return stale results if fast backward scan is used
Jira Link: DB-13007
Description
An intent could be skipped during fetching a table row in case of fast backward scan enabled and a transaction with snapshot isolation level, where the given intent is not yet applied but already committed. This could lead to a stale result of a select statement (it could return old or null values).
The issue was captured by a set of tests PgSingleTServerTest/PgFastBackwardScanTest.Simple*/Fast_*_kNone
Examples of failures:
../../src/yb/yql/pgwrapper/pg_single_tserver-test.cc:883
Failed
Bad status: Illegal state (yb/yql/pgwrapper/pg_single_tserver-test.cc:785): Unexpected result: 256, 260, 5; 256, 260, 4; NULL, 5, 3; NULL, 5, 2; 4096, 5, 1 vs 256, 260, 5; 256, 260, 4; 16384, 16388, 3; NULL, 5, 2; 4096, 5, 1
../../src/yb/yql/pgwrapper/pg_single_tserver-test.cc:902
Failed
Bad status: Illegal state (yb/yql/pgwrapper/pg_single_tserver-test.cc:785): Unexpected result: NULL, 5, 2; 4096, 5, 1; NULL, NULL, 0 vs NULL, 5, 2; 4096, 5, 1; 65536, 65540, 0
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
- [X] I confirm this issue does not contain any sensitive information.
Other tests for non-packed row case (kNone) seems also flaky and fail at the same lines: PgSingleTServerTest/PgFastBackwardScanTest.Simple/Fast_WithoutNulls_kNone (link) PgSingleTServerTest/PgFastBackwardScanTest.SimpleColocated/Fast_WithNulls_kNone (link) PgSingleTServerTest/PgFastBackwardScanTest.SimpleColocated/Fast_WithoutNulls_kNone (link)