Cockroach: jobs get created multiple times

Created on 18 Feb 2019  路  2Comments  路  Source: cockroachdb/cockroach

Describe the problem

I tried to alter a table (drop a column) and two jobs got created for a single sql statement.

To Reproduce

I tried to alter a table via Alembic AND via cockroach sql. So far this only happens when i want to drop a column. The problem is, that the statement (code or sql-cli) blocks until BOTH jobs are finished. Also, both jobs succeed even though a column can be deleted just once.

  1. Create empty schema in a 5 node cockroach cluster
  2. insert about 100k rows
  3. add column with index
  4. drop column
  5. Look at UI-JOBS OR sql-cli show jobs
  6. See same job two times with different job-ids

Expected behavior
A job for ALTER TABLE should be executed once, and the second job should fail.

Environment:

  • CockroachDB version 2.1.4
  • Docker Image 2.1.4
  • cockroach sql, SQLAlchemy, Alembic

Most helpful comment

@schorzz I went ahead and opened this issue (https://github.com/cockroachdb/cockroach/issues/35051) to improve upon this so that other users won't be similarly confused. Thank you for sharing your feedback!

All 2 comments

Apparently, cockroach deletes indices implicitly if you drop the column. Although the naming of the jobs are a little bit confusing.

@schorzz I went ahead and opened this issue (https://github.com/cockroachdb/cockroach/issues/35051) to improve upon this so that other users won't be similarly confused. Thank you for sharing your feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magaldima picture magaldima  路  3Comments

mjibson picture mjibson  路  3Comments

melskyzy picture melskyzy  路  3Comments

couchand picture couchand  路  3Comments

lwsanty picture lwsanty  路  4Comments