-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql/kv: split system and tenant "high-priority" levels #71946
Copy link
Copy link
Open
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-starterMight be suitable for a starter project for new employees or team members.Might be suitable for a starter project for new employees or team members.T-kvKV TeamKV Team
Metadata
Metadata
Assignees
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-starterMight be suitable for a starter project for new employees or team members.Might be suitable for a starter project for new employees or team members.T-kvKV TeamKV Team
Type
Projects
Status
Backlog
Currently, both the system tenant and secondary tenants use the same
MaxTxnPrioritylevel for high-priority transactions. This means that a system-tenant transaction running with high priority is not guaranteed to never block on a secondary-tenant transaction. This is a property that we would like to have for cluster-wide BACKUP, CDC, etc. in multi-tenant clusters.To allow us to make the claim that a secondary-tenant transaction can never block (at least some subset of) system-tenant transactions, we should separate
MaxTxnPriorityinto a system level and a tenant level. The system-level max priority should take precedence over the tenant-level max priority.This is not quite as simple as defining a
MaxTenantTxnPriority = MaxTxnPriority - 1and calling it a day. That's because there are a few places whereMaxTxnPriorityis given special treatment, such as in thetxnWaitQueue, in thelockTableWaiter, and in the evaluation logic forPushTxnrequests.SQL transactions running with "high priority" (
BEGIN PRIORITY HIGH) should be given a different priority depending on whether they are part of the system tenant or not. The KV host cluster should reject all BatchRequests from secondary tenants with the system-tenant's max priority level.Jira issue: CRDB-10844