Skip to content

Commit

Permalink
backup: set admission header on backup requests
Browse files Browse the repository at this point in the history
Reelase note: none.
  • Loading branch information
dt committed Mar 31, 2022
1 parent 4bce84e commit ef29359
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/ccl/backupccl/backup_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
3 changes: 3 additions & 0 deletions pkg/util/admission/work_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit ef29359

Please sign in to comment.