cockroachdb / cockroachdb/cockroach

scbuild: CatalogReader's MustReadDescriptor method should return stored descriptors

Open
#106,713 0 comments 0 reactions 0 assignees View on GitHub
A-schema-changer-impl C-bug
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Presently, this method returns uncommitted descriptors. In multi-statement txns, this can lead to inconsistencies because they're fed to scdecomp which infers the element statuses on a best-effort basis. As a consequence, the inferred statuses might actually differ from those in the incumbent target state.

This doesn't matter much yet because explicit transactions are not supported in production but we should do the right early on: decomp the descriptor such as it was before the txn and upsert with the descriptor's elements which are in the incumbent target state. Uncommitted descriptors should never be used as a source of truth in scbuild.

Jira issue: CRDB-29689

Contributor guide

Open the contributing guide

Research direction

Start at scbuild's CatalogReader.MustReadDescriptor method and trace how its result is passed to scdecomp. The change is done when scbuild uses stored descriptors from before the transaction and upserts elements from the incumbent target state rather than using uncommitted descriptors as its source of truth.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
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.