Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backupccl: mark backup ExportRequests as Bulk priority #79086

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

dt
Copy link
Member

@dt dt commented Mar 30, 2022

This adds a new "bulk normal" priority that is lower than normal user priority but higher than low user priority, and then assigns that priority on AddSSTable and Export requests.

Release note (bug fix): BACKUP read requests are now sent with lower admission control priority than normal traffic.

Jira issue: CRDB-14711
Epic CRDB-2264

@dt dt requested review from erikgrinaker and sumeerbhola March 30, 2022 20:33
@dt dt requested a review from a team as a code owner March 30, 2022 20:33
@dt dt requested review from a team and adityamaru and removed request for a team March 30, 2022 20:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt dt requested review from stevendanna and removed request for adityamaru March 31, 2022 03:09
pkg/kv/db.go Outdated Show resolved Hide resolved
@dt dt changed the title bulk: mark AddSSTable and ExportRequest as Bulk Priority bulk: mark backup ExportRequest as Bulk Priority Mar 31, 2022
@dt dt force-pushed the admission-bulk branch from 146ecb0 to dffb0fa Compare March 31, 2022 13:51
@dt
Copy link
Member Author

dt commented Mar 31, 2022

I'm dropping the AddSSTable part from this and addressing it in #79126.

@dt
Copy link
Member Author

dt commented Mar 31, 2022

changed the source on the backup reqs to FROM_SQL while I'm here. RFAL.

@dt dt force-pushed the admission-bulk branch from dffb0fa to 6d3a846 Compare March 31, 2022 14:09
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1, 2 of 2 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt and @stevendanna)


pkg/ccl/backupccl/backup_processor.go, line 415 at r3 (raw file):

						Priority:                 int32(admission.BulkNormalPri),
						CreateTime:               timeutil.Now().UnixNano(),
						Source:                   roachpb.AdmissionHeader_FROM_SQL,

is this actually originating in SQL? That is, will there be distsql processing upstream of this?


pkg/util/admission/work_queue.go, line 157 at r3 (raw file):

	// BulkNormalPri is bulk priority work from bulk jobs, which could be run due
	// to user submissions or be automatic.
	BulkNormalPri WorkPriority = -49

how about -25. Leaving gaps on both sides allows us to squeeze other things in there in the future.

Copy link
Member Author

@dt dt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt, @stevendanna, and @sumeerbhola)


pkg/ccl/backupccl/backup_processor.go, line 415 at r3 (raw file):

Previously, sumeerbhola wrote…

is this actually originating in SQL? That is, will there be distsql processing upstream of this?

this is a distsql processor, if that's what you mean?

This is a distsql processor that is running in a distsql flow, which is launched by a job resumer from a job registry, which is something sql processes start at boot. The job is running because a sql query wrote it.


pkg/util/admission/work_queue.go, line 157 at r3 (raw file):

Previously, sumeerbhola wrote…

how about -25. Leaving gaps on both sides allows us to squeeze other things in there in the future.

ah, good call. How do you feel about -40 or -30?

@dt dt force-pushed the admission-bulk branch from 6d3a846 to ef29359 Compare March 31, 2022 14:32
@dt dt changed the title bulk: mark backup ExportRequest as Bulk Priority bulk: mark backup ExportRequests as Bulk priority Mar 31, 2022
@dt dt changed the title bulk: mark backup ExportRequests as Bulk priority backupccl: mark backup ExportRequests as Bulk priority Mar 31, 2022
@dt
Copy link
Member Author

dt commented Mar 31, 2022

Marking this 22.1 backport, and I sorta think this should get a 21.2 backport as well (along with the col backfill and addstable enrollments in admission control, so that we can say all bulk work has the headers)?

@dt
Copy link
Member Author

dt commented Mar 31, 2022

@sumeerbhola is it safe to backport new named priorities such as the one here?

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sumeerbhola is it safe to backport new named priorities such as the one here?

Not Sumeer, but I believe that should be fine -- the priority is an int32 field, not an enum, so arbitrary values will be handled correctly:

int32 priority = 1;

This is a distsql processor that is running in a distsql flow, which is launched by a job resumer from a job registry, which is something sql processes start at boot. The job is running because a sql query wrote it.

That's how I think about this too.

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the priority is an int32 field, not an enum, so arbitrary values will be handled correctly

correct.

:lgtm:

Reviewed 1 of 1 files at r4.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt, @erikgrinaker, and @stevendanna)


pkg/ccl/backupccl/backup_processor.go, line 415 at r3 (raw file):

this is a distsql processor, if that's what you mean?

yep. thanks.


pkg/util/admission/work_queue.go, line 157 at r3 (raw file):

Previously, dt (David Taylor) wrote…

ah, good call. How do you feel about -40 or -30?

-30, that you have here is fine

@dt
Copy link
Member Author

dt commented Apr 4, 2022

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 4, 2022

Build succeeded:

@craig craig bot merged commit f9a476c into cockroachdb:master Apr 4, 2022
@blathers-crl
Copy link

blathers-crl bot commented Apr 4, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from ef29359 to blathers/backport-release-21.2-79086: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 21.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bulk: export requests should use lower priority admission header
4 participants