cockroachdb / cockroachdb/cockroach

basalt-26.3.2-rc-20260908: pkg/sql/sqlstats/sqlstats_test: TestDataDrivenTest failed

Open
#174,989 1 comment 0 reactions 0 assignees View on GitHub
branch-basalt-26.3.2-rc-20260908 C-test-failure O-robot release-blocker T-observability
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

pkg/sql/sqlstats/sqlstats_test.TestDataDrivenTest [failed](https://mesolite.cluster.engflow.com/invocations/default/4e6b3e4b-4f3a-4ae0-ac38-acabe7fa7d66?testReportRun=1&testReportShard=1&testReportAttempt=1#targets-Ly9wa2cvc3FsL3NxbHN0YXRzOnNxbHN0YXRzX3Rlc3Q=) on basalt-26.3.2-rc-20260908 @ [807558e5e81666af257c811e925e4cae570abc28](https://github.com/cockroachdb/cockroach/commits/807558e5e81666af257c811e925e4cae570abc28):

```
RETURNS INT
LANGUAGE SQL
AS $$
INSERT INTO test(select random_int());
SELECT max(a) FROM test;
$$
VOLATILE;
----
sqlstats_test.go:53:
/mnt/engflow/worker/work/1/exec/bazel-out/k8-fastbuild/bin/pkg/sql/sqlstats/sqlstats_test_/sqlstats_test.runfiles/com_github_cockroachdb_cockroach/pkg/sql/sqlstats/testdata/udf:20:
exec-sql db=udf_test app-name=udf
SELECT random_int();
select do_something();
----
sqlstats_test.go:53:
/mnt/engflow/worker/work/1/exec/bazel-out/k8-fastbuild/bin/pkg/sql/sqlstats/sqlstats_test_/sqlstats_test.runfiles/com_github_cockroachdb_cockroach/pkg/sql/sqlstats/testdata/udf:25:
show-stats db=udf_test app-name=udf
----
{"count": "1", "fingerprint_id": "34c73026fa901192", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": true, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT max(a) FROM udf_test.public.test", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT max(a) FROM udf_test.public.test", "svc_lat_not_zero": true, "transaction_fingerprint_id": "b35d68ca1dbe65e2"}
{"count": "1", "fingerprint_id": "5bea038ef190748b", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT random_int()", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT random_int()", "svc_lat_not_zero": true, "transaction_fingerprint_id": "b35d68ca1dbe65e2"}
{"count": "1", "fingerprint_id": "790abc99984823ea", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "CREATE FUNCTION random_int()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tVOLATILE\n\tAS $$_$$", "run_lat_not_zero": true, "sql_type": "TypeDDL", "summary": "CREATE FUNCTION random_int()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tVOLATILE\n\tAS $$_$$", "svc_lat_not_zero": true, "transaction_fingerprint_id": "d66901d51e499435"}
{"count": "1", "fingerprint_id": "82b6e892da6f1a4b", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "CREATE FUNCTION do_something()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tVOLATILE\n\tAS $$_$$", "run_lat_not_zero": true, "sql_type": "TypeDDL", "summary": "CREATE FUNCTION do_something()\n\tRETURNS INT8\n\tLANGUAGE SQL\n\tVOLATILE\n\tAS $$_$$", "svc_lat_not_zero": true, "transaction_fingerprint_id": "2dd555de5c6ead94"}
{"count": "1", "fingerprint_id": "a48f10bb3110825e", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT do_something()", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT do_something()", "svc_lat_not_zero": true, "transaction_fingerprint_id": "b35d68ca1dbe65e2"}
{"count": "2", "fingerprint_id": "ad8c3186c0ae14a2", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT floor(random() * _)::INT8", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT floor(random() ...)...", "svc_lat_not_zero": true, "transaction_fingerprint_id": "b35d68ca1dbe65e2"}
{"count": "1", "fingerprint_id": "bf73cd8472f898fd", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "INSERT INTO udf_test.public.test (SELECT public.random_int())", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "INSERT INTO udf_test.public.test", "svc_lat_not_zero": true, "transaction_fingerprint_id": "b35d68ca1dbe65e2"}
{"count": "1", "fingerprint_id": "f17c354bb29f8432", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "CREATE TABLE IF NOT EXISTS test (a INT8)", "run_lat_not_zero": true, "sql_type": "TypeDDL", "summary": "CREATE TABLE IF NOT EXISTS test (a INT8)", "svc_lat_not_zero": true, "transaction_fingerprint_id": "5e1f8807349e33ed"}
sqlstats_test.go:53:
/mnt/engflow/worker/work/1/exec/bazel-out/k8-fastbuild/bin/pkg/sql/sqlstats/sqlstats_test_/sqlstats_test.runfiles/com_github_cockroachdb_cockroach/pkg/sql/sqlstats/testdata/udf:36:
exec-sql db=udf_test app-name=udf_transactions
BEGIN;
select do_something();
select do_something();
COMMIT;
----
sqlstats_test.go:53:
/mnt/engflow/worker/work/1/exec/bazel-out/k8-fastbuild/bin/pkg/sql/sqlstats/sqlstats_test_/sqlstats_test.runfiles/com_github_cockroachdb_cockroach/pkg/sql/sqlstats/testdata/udf:43:
show-stats db=udf_test app-name=udf_transactions

expected:
{"count": "2", "fingerprint_id": "34c73026fa901192", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": true, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT max(a) FROM udf_test.public.test", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT max(a) FROM udf_test.public.test", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
{"count": "2", "fingerprint_id": "a48f10bb3110825e", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT do_something()", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT do_something()", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
{"count": "2", "fingerprint_id": "ad8c3186c0ae14a2", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT floor(random() * _)::INT8", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT floor(random() ...)...", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
{"count": "2", "fingerprint_id": "bf73cd8472f898fd", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "INSERT INTO udf_test.public.test (SELECT public.random_int())", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "INSERT INTO udf_test.public.test", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}

found:
{"count": "4", "fingerprint_id": "34c73026fa901192", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": true, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT max(a) FROM udf_test.public.test", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT max(a) FROM udf_test.public.test", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
{"count": "4", "fingerprint_id": "a48f10bb3110825e", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT do_something()", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT do_something()", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
{"count": "4", "fingerprint_id": "ad8c3186c0ae14a2", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "SELECT floor(random() * _)::INT8", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "SELECT floor(random() ...)...", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
{"count": "4", "fingerprint_id": "bf73cd8472f898fd", "nodes": [1], "parse_lat_not_zero": true, "plan_distributed": false, "plan_full_scan": false, "plan_hash_set": true, "plan_lat_not_zero": true, "plan_vectorized": true, "query": "INSERT INTO udf_test.public.test (SELECT public.random_int())", "run_lat_not_zero": true, "sql_type": "TypeDML", "summary": "INSERT INTO udf_test.public.test", "svc_lat_not_zero": true, "transaction_fingerprint_id": "f0ee0c57232d686d"}
--- FAIL: TestDataDrivenTest/udf (70.50s)
```

Parameters:
- attempt=1
- race=true
- run=1
- shard=1
Help

See also: [How To Investigate a Go Test Failure \(internal\)](https://cockroachlabs.atlassian.net/l/c/HgfXfJgM)

Same failure on other branches

- #174923 basalt-26.3: pkg/sql/sqlstats/sqlstats_test: TestDataDrivenTest failed [C-test-failure O-robot T-observability branch-basalt-26.3 release-blocker]
- #174361 pkg/sql/sqlstats/sqlstats_test: TestDataDrivenTest failed [C-test-failure O-robot T-observability branch-master]
- #173936 basalt-26.3: pkg/sql/sqlstats/sqlstats_test: TestDataDrivenTest failed [C-test-failure O-robot T-observability branch-basalt-26.3 release-blocker]
- #173235 release-26.3.0-rc: pkg/sql/sqlstats/sqlstats_test: TestDataDrivenTest failed [C-test-failure O-robot T-observability branch-release-26.3.0-rc]

/cc @cockroachlabs/obs-prs

[This test on roachdash](https://roachdash.crdb.dev/?filter=status:open%20t:.*TestDataDrivenTest.*&sort=title+created&display=lastcommented+project) | [Improve this report!](https://github.com/cockroachdb/cockroach/tree/master/pkg/cmd/bazci/githubpost/issues)

Contributor guide

Open the contributing guide

Research direction

Start with pkg/sql/sqlstats/sqlstats_test.go and pkg/sql/sqlstats/testdata/udf, then run TestDataDrivenTest/udf to reproduce the failure. Compare the expected and found SQL statistics, especially the doubled counts in the transaction case, and review the linked failures on other branches. Done means the test passes with the intended statistics consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases, observability, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.