yugabyte-db icon indicating copy to clipboard operation
yugabyte-db copied to clipboard

[DocDB] Select statement may return stale results if fast backward scan is used

Open arybochkin opened this issue 1 year ago • 1 comments

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

Stability history Trends

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.

arybochkin avatar Sep 24 '24 18:09 arybochkin

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)

arybochkin avatar Sep 25 '24 08:09 arybochkin