cockroachdb / cockroachdb/cockroach

import: consider waiting for the descriptor to become public after an error

Open
#123,262 0 comments 0 reactions 0 assignees View on GitHub
A-import C-enhancement E-quick-win T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Import jobs use `WaitForOneVersion` through the [collections txn API](https://github.com/cockroachdb/cockroach/blob/5a4bae3920f918ad2b31653aa65d4648c6020fe5/pkg/sql/exec_util.go#L3889-L3893) to wait until all stale versions of a table descriptor expire after it is marked offline for the import, or public after the import finishes. However, this blocking does not happen when the Import encounters an error. Instead, the error is [returned immediately](https://github.com/cockroachdb/cockroach/blob/5a4bae3920f918ad2b31653aa65d4648c6020fe5/pkg/sql/internal.go#L1899-L1902) to the user, after which the table may appear to be offline until the remaining leases happen to expire. This behavior can be confusing and alarming, since users often expect the table to be offline only until the Import statement returns.

Jira issue: CRDB-38262

Epic CRDB-62881

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.