cockroachdb / cockroachdb/cockroach

Randomized testing of enforce_home_region

Open
#102,250 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Is your feature request related to a problem? Please describe.**
The enforce_home_region session setting relies on a Distribute operator being generated for all queries or query constructs (such as scalar expressions built from query expressions). To increase confidence that this operator is built in all necessary cases, randomized testing of enforce_home_region could be added.

**Describe the solution you'd like**
The best form of randomized testing is not known at this time. Maybe instrument the KV API to error out if it tries to access remote rows, or construct a Jepsen-like framework to prove no remote accesses occurred for a queries or sequence of SQL statements.

**Describe alternatives you've considered**
Brainstorming and manual testing to verify all constructs are covered, e.g. subqueries, cascades, apply join, etc.

**Additional context**
PR #102103 highlights a recent case where the Distribute operator failed to get generated when needed.

Jira issue: CRDB-27366
Epic: CRDB-34182

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.