cockroachdb / cockroachdb/cockroach

LogicTest needs real session managment

Open
#150,566 1 comment 0 reactions 0 assignees View on GitHub
A-testing C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

While investigating #150466, I discovered that there is no guarantee that statements will all be executed in deterministic sessions if an 'async' clause causes an additional connection to be spawned. Usually the async statement or query will be executed by the same session that runs the statement previous, with the next statement getting a new connection, but this is behavior is not guaranteed.

This nondeterminism is extremely limiting when writing tests to test concurrency controls within the database (e.g. locking). Logic test infrastructure should provide a mechanism to control what session/connection a given statement is issued on, ideally one that is backward compatible with existing tests.

Jira issue: CRDB-52772

Contributor guide

Open the contributing guide

Research direction

Start by locating the LogicTest infrastructure and tracing how async statements select or spawn connections, using the behavior described in #150466 as context. The work is done when tests can explicitly control the session or connection for a statement, existing tests remain backward compatible, and concurrency controls such as locking can run deterministically.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.