cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql: No way to get insight into VALIDATE CONSTRAINT progress

Open jseldess opened this issue 8 years ago • 12 comments

After running alter table vehicles validate constraint fk_owner_id_ref_users;, I assumed it should be possible to track the execution status, but neither SHOW CLUSTER QUERIES nor SHOW JOBS represented it.

I think there should be a way to get insight into this via the CLI or Admin UI.

cc: @knz

Jira issue: CRDB-4992

jseldess avatar Jun 12 '18 15:06 jseldess

cc @dt @mjibson for triage and prioritization

knz avatar Jun 13 '18 08:06 knz

Issue encountered on gitter by @lkarlslund today

knz avatar Jul 13 '18 09:07 knz

If validate wait times scale with database sizes, this UX problem is going to come up more frequently as we market scalability. I've been waiting for several minutes for my current ALTER and it's not clear if I should kill the job or wait longer.

@vivekmenezes is there a workaround for determining if this is slow or just stuck?

cc @awoods187

nstewart avatar Dec 08 '18 15:12 nstewart

@nstewart are you testing with the latest alpha/2.1.2? The reason I ask is because we have a bug #32118 which I feel is fixed through a fix I merge last week.

vivekmenezes avatar Dec 10 '18 02:12 vivekmenezes

Hey @vivekmenezes - this is coming up again and a customer is asking how to determine whether or not validation is progressing. Is there a method available?

tim-o avatar Dec 13 '18 16:12 tim-o

On the latest alpha v2.2.0-alpha.20181217 I see:

pq: root: memory budget exceeded: 8935128 bytes requested, 128348184 currently allocated, 134217728 bytes in budget
pq: root: memory budget exceeded: 8935128 bytes requested, 128348184 currently allocated, 134217728 bytes in budget

And there is still no job that says what's happening.

To reproduce, just follow the steps to load the 1M movr dataset here: https://github.com/cockroachdb/movr

nstewart avatar Dec 20 '18 15:12 nstewart

Thanks Nate! Fortunately @lucy-zhang has been able to reproduce the problem with it hanging. She's investigating the issue. Once she's done with fixing it she can run the steps here and double check that they work.

We don't necessarily need a job for this since the query execution is happening as part of the validation (just like any distsql query), the problem here really is the query hanging.

vivekmenezes avatar Dec 20 '18 16:12 vivekmenezes

Zendesk ticket #3020 has been linked to this issue.

tim-o avatar Mar 15 '19 18:03 tim-o

Quick update: Some of the performance issues related to VALIDATE CONSTRAINT alluded to above have been fixed, but the fact remains that currently there's no good way to give progress updates on VALIDATE since we're just running a select query to find invalid rows. We'd need some way to get query progress. So this is on hold for the foreseeable future.

thoszhang avatar Apr 30 '20 18:04 thoszhang

btw: https://github.com/cockroachdb/cockroach/pull/42518

dt avatar May 04 '20 17:05 dt

A note that a client recently would have benefited from this (meaningful progress during schema validation). Conversation in Slack, you can ping me if interested.

shermanCRL avatar Jul 09 '21 18:07 shermanCRL

This probably depends on fixing https://github.com/cockroachdb/cockroach/issues/55758 in order to use the progress reporting added in https://github.com/cockroachdb/cockroach/pull/42518.

michae2 avatar Oct 30 '25 20:10 michae2