sql: No way to get insight into VALIDATE CONSTRAINT progress
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
cc @dt @mjibson for triage and prioritization
Issue encountered on gitter by @lkarlslund today
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 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.
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?
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
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.
Zendesk ticket #3020 has been linked to this issue.
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.
btw: https://github.com/cockroachdb/cockroach/pull/42518
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.
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.