cockroachdb / cockroachdb/cockroach

QA: redact errors output during explain analyze (redact)

Open
#99,136 0 comments 0 reactions 0 assignees View on GitHub
A-sql-debug-bundle A-sql-explain C-bug O-qa S-2 T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

When a query fails during an `explain analyze ... redact`, we currently may include constants we would expect to be redacted in the error output.

In the following query and output using MOVR on cockroach demo:
```
EXPLAIN ANALYZE (PLAN, REDACT) INSERT INTO vehicle_location_histories (city, ride_id, timestamp, lat, long) VALUES ('amsterdam', 'cd032f56-cf1a-4800-8000-00000000066f', current_timestamp(), -101, 60)
ERROR: insert on table "vehicle_location_histories" violates foreign key constraint "vehicle_location_histories_city_ride_id_fkey"
SQLSTATE: 23503
DETAIL: Key (city, ride_id)=('amsterdam', 'cd032f56-cf1a-4800-8000-00000000066f') is not present in table "rides".
CONSTRAINT: vehicle_location_histories_city_ride_id_fkey
```

We would expect constants like 'amsterdam', 'cd032f56-cf1a-4800-8000-00000000066f' to be redacted from the explain output, so should we expect them to be redacted from the error output as well?

Jira issue: CRDB-25719

Contributor guide

Open the contributing guide

Research direction

No source file or test is named in the issue. Reproduce the MOVR EXPLAIN ANALYZE (PLAN, REDACT) INSERT failure, then trace how the redacted explain path formats its error output. Done means confirming that constants such as the city and ride ID are redacted in the returned error while the diagnostic remains useful.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.