Skip to content

[YSQL] JDBC API statement.getMoreResults() reads could case inconsistent reads #29451

@qvad

Description

@qvad

Jira Link: DB-19247

Description

Recently we added usage of getMoreResults JDBC method to our consistency validation workload
This cause inconsistent reads:

2025-11-20 23:12:05,335 [Thread-180] ERROR ExceptionsTracker - Failed to compare sums: Expected 1000000 - actual 999999, SeqScan,  WHERE id >= 0 OR id IS NULL, sum pipeline: true
2025-11-20 23:12:05,339 [Thread-115] ERROR ExceptionsTracker - Failed to compare sums: Expected 1000000 - actual 999999, IndexScan,  WHERE id >= 0 OR id IS NULL, sum pipeline: true
2025-11-20 23:12:05,341 [Thread-110] ERROR ExceptionsTracker - Failed to compare sums: Expected 1000000 - actual 1000006, IndexOnlyScan, , sum pipeline: true
2025-11-20 23:12:05,342 [Thread-101] ERROR ExceptionsTracker - Failed to compare sums: Expected 1000000 - actual 1000004, SeqScan, , sum pipeline: true

Looks like we always missing reads for only few keys.

Same workload pass in Postgres

        while (hasResult) {
            try (ResultSet rs = statement.getResultSet()) {
                if (rs != null && rs.next()) {
                    sum += rs.getInt(1);
                }
            }
            hasResult = statement.getMoreResults();
        }
        return sum;

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions