You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
154136: sql/inspect: add progress tracking to INSPECT r=spilchen a=spilchen
Previously, when you ran an INSPECT job we didn't maintain any kind of progress tracking. This commit adds it. The granularity that we use for progress tracking is with checks x spans. Note: each check won't always use all spans, so we only count spans that apply to the check.
The processors flow back the completed checks (per span) they have done. A goroutine runs at the coordinator that will periodically (every 10 seconds) update the job data with the progress update.
Informs #148297
Release note: none
Epic: CRDB-30356
154255: sql/import: pass deep copy of BulkOpSummary to progress r=ZhouXing19 a=ZhouXing19
Fixes: #153480
Prior to this change, we passed the `BulkOpSummary` map directly from `accumulatedBulkSummary` to `prog.Summary` in #152745. This caused a `concurrent map iteration and map write` panic because the map was being updated via `metaFn` while simultaneously being marshaled into a protobuf during `jobs.Update` calls from `FractionProgressed`.
This change creates a deep copy of the map when assigning from `accumulatedBulkSummary` to `prog.Summary`, eliminating the concurrency issue by ensuring each goroutine operates on separate map instances.
Release Notes: None
Co-authored-by: Matt Spilchen <[email protected]>
Co-authored-by: ZhouXing19 <[email protected]>
r.QueryRow(t, `SELECT status FROM [SHOW JOBS] WHERE job_type = 'INSPECT' ORDER BY job_id DESC LIMIT 1`).Scan(&jobStatus)
521
+
varfractionCompletedfloat64
522
+
r.QueryRow(t, `SELECT status, fraction_completed FROM [SHOW JOBS] WHERE job_type = 'INSPECT' ORDER BY job_id DESC LIMIT 1`).Scan(&jobStatus, &fractionCompleted)
522
523
523
524
iftc.expectedErrRegex=="" {
524
525
require.Equal(t, "succeeded", jobStatus, "expected job to succeed when no issues found")
526
+
require.InEpsilon(t, 1.0, fractionCompleted, 0.01, "progress should reach 100%% on successful completion")
525
527
} else {
526
528
require.Equal(t, "failed", jobStatus, "expected job to fail when inconsistencies found")
require.NoError(t, err, "should succeed on table with reserved word column names")
576
578
require.Equal(t, 0, issueLogger.numIssuesFound(), "No issues should be found in happy path test")
577
579
578
-
// Verify job succeeded
580
+
// Verify job succeeded and progress reached 100%
579
581
varjobStatusstring
580
-
r.QueryRow(t, `SELECT status FROM [SHOW JOBS] WHERE job_type = 'INSPECT' ORDER BY job_id DESC LIMIT 1`).Scan(&jobStatus)
582
+
varfractionCompletedfloat64
583
+
r.QueryRow(t, `SELECT status, fraction_completed FROM [SHOW JOBS] WHERE job_type = 'INSPECT' ORDER BY job_id DESC LIMIT 1`).Scan(&jobStatus, &fractionCompleted)
581
584
require.Equal(t, "succeeded", jobStatus, "INSPECT job should succeed")
585
+
require.InEpsilon(t, 1.0, fractionCompleted, 0.01, "progress should reach 100%% on successful completion")
0 commit comments