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: New crdb_internal.jobs columns did not get added to SHOW JOBS #70765

Closed
vy-ton opened this issue Sep 27, 2021 · 1 comment · Fixed by #70766
Closed

sql: New crdb_internal.jobs columns did not get added to SHOW JOBS #70765

vy-ton opened this issue Sep 27, 2021 · 1 comment · Fixed by #70766
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. GA-blocker T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@vy-ton
Copy link
Contributor

vy-ton commented Sep 27, 2021

Describe the problem

In #44594, new columns were added to crdb_internal.jobs as part of adding the jobs retry infrastructure. We plan to surface these changes in the DBConsole (#68179), but forgot to change the output of SHOW JOBS

To Reproduce

root@localhost:26257/defaultdb> show columns from crdb_internal.jobs;
      column_name      | data_type | is_nullable | column_default | generation_expression | indices | is_hidden
-----------------------+-----------+-------------+----------------+-----------------------+---------+------------
  job_id               | INT8      |    true     | NULL           |                       | {}      |   false
  job_type             | STRING    |    true     | NULL           |                       | {}      |   false
  description          | STRING    |    true     | NULL           |                       | {}      |   false
  statement            | STRING    |    true     | NULL           |                       | {}      |   false
  user_name            | STRING    |    true     | NULL           |                       | {}      |   false
  descriptor_ids       | INT8[]    |    true     | NULL           |                       | {}      |   false
  status               | STRING    |    true     | NULL           |                       | {}      |   false
  running_status       | STRING    |    true     | NULL           |                       | {}      |   false
  created              | TIMESTAMP |    true     | NULL           |                       | {}      |   false
  started              | TIMESTAMP |    true     | NULL           |                       | {}      |   false
  finished             | TIMESTAMP |    true     | NULL           |                       | {}      |   false
  modified             | TIMESTAMP |    true     | NULL           |                       | {}      |   false
  fraction_completed   | FLOAT8    |    true     | NULL           |                       | {}      |   false
  high_water_timestamp | DECIMAL   |    true     | NULL           |                       | {}      |   false
  error                | STRING    |    true     | NULL           |                       | {}      |   false
  coordinator_id       | INT8      |    true     | NULL           |                       | {}      |   false
  trace_id             | INT8      |    true     | NULL           |                       | {}      |   false
  last_run             | TIMESTAMP |    true     | NULL           |                       | {}      |   false
  next_run             | TIMESTAMP |    true     | NULL           |                       | {}      |   false
  num_runs             | INT8      |    true     | NULL           |                       | {}      |   false
  execution_errors     | STRING[]  |    true     | NULL           |                       | {}      |   false
(21 rows)
root@localhost:26257/defaultdb> show jobs;
        job_id       |     job_type     |                                      description                                       | statement | user_name |  status   |   running_status   |          created           |          started           |          finished          |          modified          | fraction_completed | error | coordinator_id | trace_id

Expected behavior
Maintain crdb_internal.jobs and SHOW JOBS as mirrors of each other

@vy-ton vy-ton added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Sep 27, 2021
@blathers-crl blathers-crl bot added the T-sql-schema-deprecated Use T-sql-foundations instead label Sep 27, 2021
ajwerner added a commit to ajwerner/cockroach that referenced this issue Sep 27, 2021
New columns were added to `crdb_internal.jobs` to expose retry and
exponential backoff state. This commit exposes them in `SHOW JOBS`.

No need for a version gate because the virtual table is local and will
just populate the columns with NULL in the mixed version state.

Fixes cockroachdb#70765.

Release note (sql change): `SHOW JOBS` will now include the newly added
columns from `crdb_internal.jobs` (`last_run`, `next_run`, `num_runs`,
and `execution_errors`). The columns capture state related to retries,
failures, and exponential backoff.
@blathers-crl
Copy link

blathers-crl bot commented Sep 27, 2021

Hi @ajwerner, please add branch-* labels to identify which branch(es) this release-blocker affects.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

craig bot pushed a commit that referenced this issue Sep 27, 2021
70683: sql: add backward compatibility to stats and plan r=maryliag a=maryliag

Previously, if a key didn't exist on a JSON payload for
statement/transaction stats and plan, the decoder would return
an error and the page would not load on Console.
This commit changes the behaviour, returning the value as
nil, so the page can continue to load normally and only that
particular value would be kept as empty.

Fix #70599

Release Justification: Category 2, bug fix
Release note: None

70766: sql/delegate: pick up new 21.2 columns in `SHOW JOBS` r=fqazi a=ajwerner

New columns were added to `crdb_internal.jobs` to expose retry and
exponential backoff state. This commit exposes them in `SHOW JOBS`.

No need for a version gate because the virtual table is local and will
just populate the columns with NULL in the mixed version state.

Fixes #70765.

Release note (sql change): `SHOW JOBS` will now include the newly added
columns from `crdb_internal.jobs` (`last_run`, `next_run`, `num_runs`,
and `execution_errors`). The columns capture state related to retries,
failures, and exponential backoff.

70769: roachprod/vm/aws: improve help text for multiple stores r=ajwerner a=ajwerner

```bash
roachprod create ajwerner-test -n1 --clouds aws \
--aws-ebs-volume='{"VolumeType": "io2", "VolumeSize": 213, "Iops": 321}' \
--aws-ebs-volume='{"VolumeType": "io2", "VolumeSize": 213, "Iops": 321}' \
--aws-enable-multiple-stores=true
roachprod stage ajwerner-test cockroach
roachprod start ajwerner-test --store-count 2
```

The above commands will create a node with multiple stores and start cockroach
on them. Hopefully these minor help changes make that clearer.

Release note: None

Co-authored-by: Marylia Gutierrez <marylia@cockroachlabs.com>
Co-authored-by: Andrew Werner <awerner32@gmail.com>
@craig craig bot closed this as completed in 09e7c13 Sep 27, 2021
blathers-crl bot pushed a commit that referenced this issue Sep 27, 2021
New columns were added to `crdb_internal.jobs` to expose retry and
exponential backoff state. This commit exposes them in `SHOW JOBS`.

No need for a version gate because the virtual table is local and will
just populate the columns with NULL in the mixed version state.

Fixes #70765.

Release note (sql change): `SHOW JOBS` will now include the newly added
columns from `crdb_internal.jobs` (`last_run`, `next_run`, `num_runs`,
and `execution_errors`). The columns capture state related to retries,
failures, and exponential backoff.
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. GA-blocker T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants