Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: specific strings in table data cause job to never terminate #50198

Closed
knz opened this issue Jun 15, 2020 · 0 comments · Fixed by #52015
Closed

sql: specific strings in table data cause job to never terminate #50198

knz opened this issue Jun 15, 2020 · 0 comments · Fixed by #52015
Labels
A-schema-changes C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@knz
Copy link
Contributor

knz commented Jun 15, 2020

Run the following SQL:

> CREATE TABLE t AS SELECT 'must be after GC replica threshold' AS x;
> ALTER TABLE t ADD COLUMN y INT AS (x::INT) STORED;

Observe: the job remains in status "running" forever

root@/defaultdb> show jobs;
-[ RECORD 1 ]
job_id             | 564125022800936961
job_type           | SCHEMA CHANGE
description        | ALTER TABLE defaultdb.public.t ADD COLUMN y INT8 AS (x::INT8) STORED
statement          |
user_name          | root
status             | running
running_status     | populating schema
created            | 2020-06-15 13:28:14.555411+00:00
started            | 2020-06-15 13:28:14.56666+00:00
finished           | NULL
modified           | 2020-06-15 13:30:13.527146+00:00
fraction_completed | 0
error              |
coordinator_id     | 1

This bug had been predicted all the way in this and that RFC sections.

The problem is this code in isPermanentSchemaChangeError():

  // Ignore error thrown because of a read at a very old timestamp.
  // The Backfill will grab a new timestamp to read at for the rest
  // of the backfill.
  if strings.Contains(⊙.Error(), "must be after replica GC threshold") {
    return false
  }

(With kudos to @ajwerner for helping me figuring out the exact example syntax)

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-schema-changes labels Jun 15, 2020
ajwerner added a commit to ajwerner/cockroach that referenced this issue Jul 28, 2020
…rror

Fixes cockroachdb#50198.

See the issue for more details. This issue is so obscure it does not deserve
a release note.

Release note: None
craig bot pushed a commit that referenced this issue Jul 29, 2020
52015: sql: use a structured error to detect roachpb.BatchTimestampBeforeGCE… r=ajwerner a=ajwerner

…rror

Fixes #50198.

See the issue for more details. This issue is so obscure it does not deserve
a release note.

Release note: None

52040: roachtest: fix release-20.1 roachtests failing due to double-init r=irfansharif a=irfansharif

Fixes #51965 (and all referencing issues).

Roachprod clusters running v20.1+ crdb nodes persist this
`cluster-bootstrapped` file on disk after explicitly bootstrapping the
cluster. Roachprod then uses the existence of this file to avoid doubly
bootstrapping the cluster.

Given #51897 remains unresolved, master-built roachprod is used to run
roachtests against the 20.1 branch. Some of those roachtests test
mixed-version clusters that start off at 19.2. Consequently, we manually
add this file where roachprod expects to find it for already-initialized
clusters. (This is a pretty gross hack, that we should address by
addressing #51897.)

Release note: None

Co-authored-by: Andrew Werner <ajwerner@cockroachlabs.com>
Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
@craig craig bot closed this as completed in 27f8f1e Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-schema-changes C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant