Skip to content

Commit 1370142

Browse files
committed
jobs: avoid unnecessary system.job_progress updates
This avoid unnecessary job progress updates when a user issues job control statements such as pause and unpause. Epic: none Release note: None
1 parent 7635297 commit 1370142

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pkg/bench/rttanalysis/testdata/benchmark_expectations

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ exp,benchmark
6161
8,Grant/grant_all_on_3_tables
6262
12,GrantRole/grant_1_role
6363
16,GrantRole/grant_2_roles
64-
12-15,Jobs/cancel_job
64+
9-12,Jobs/cancel_job
6565
3,Jobs/crdb_internal.system_jobs
6666
3-5,Jobs/jobs_page_default
6767
3,Jobs/jobs_page_latest_50
6868
3,Jobs/jobs_page_type_filtered
6969
1-3,Jobs/jobs_page_type_filtered_no_matches
7070
2,Jobs/non_admin_crdb_internal.system_jobs
7171
2,Jobs/non_admin_show_jobs
72-
12-15,Jobs/pause_job
73-
12-15,Jobs/resume_job
72+
9-12,Jobs/pause_job
73+
9-12,Jobs/resume_job
7474
3,Jobs/show_job
7575
3-5,Jobs/show_jobs
7676
3,ORMQueries/activerecord_type_introspection_query

pkg/jobs/update.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ WHERE id = $1
293293
}
294294
}
295295

296-
if progress != nil {
296+
// NB: if ju.md.Progress was non-nil then progress has been set to the value
297+
// from the updater. If it isn't set, progress has the value from the original
298+
// scan.
299+
if ju.md.Progress != nil {
297300
var ts hlc.Timestamp
298301
if hwm := progress.GetHighWater(); hwm != nil {
299302
ts = *hwm

0 commit comments

Comments
 (0)