From 296cb9128929a0bbc41cea407af7bbb0fdad998c Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 30 Mar 2022 20:29:51 +0000 Subject: [PATCH] backup: set admission header on backup requests Reelase note: none. --- pkg/ccl/backupccl/backup_processor.go | 10 +++------- pkg/util/admission/work_queue.go | 3 +++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/ccl/backupccl/backup_processor.go b/pkg/ccl/backupccl/backup_processor.go index 55db29c741bf..ea4e89230824 100644 --- a/pkg/ccl/backupccl/backup_processor.go +++ b/pkg/ccl/backupccl/backup_processor.go @@ -409,14 +409,10 @@ func runBackupProcessor( admissionHeader := roachpb.AdmissionHeader{ // Export requests are currently assigned NormalPri. // - // TODO(bulkio): the priority should vary based on the urgency of - // these background requests. These exports should get LowPri, - // unless they are being retried and need to be completed in a - // timely manner for compliance with RPO and data retention - // policies. Consider deriving this from the UserPriority field. - Priority: int32(admission.NormalPri), + // TODO(dt): Consider linking this to/from the UserPriority field. + Priority: int32(admission.BulkNormalPri), CreateTime: timeutil.Now().UnixNano(), - Source: roachpb.AdmissionHeader_ROOT_KV, + Source: roachpb.AdmissionHeader_FROM_SQL, NoMemoryReservedAtSource: true, } log.Infof(ctx, "sending ExportRequest for span %s (attempt %d, priority %s)", diff --git a/pkg/util/admission/work_queue.go b/pkg/util/admission/work_queue.go index 7fe95862e59f..fc86f6fa451f 100644 --- a/pkg/util/admission/work_queue.go +++ b/pkg/util/admission/work_queue.go @@ -152,6 +152,9 @@ const ( TTLLowPri WorkPriority = -100 // UserLowPri is low priority work from user submissions (SQL). UserLowPri WorkPriority = -50 + // BulkNormalPri is bulk priority work from bulk jobs, which could be run due + // to user submissions or be automatic. + BulkNormalPri WorkPriority = -30 // NormalPri is normal priority work. NormalPri WorkPriority = 0 // UserHighPri is high priority work from user submissions (SQL).