cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.01k stars 3.79k forks source link

sql: use background QoS for COPY #113704

Closed sumeerbhola closed 11 months ago

sumeerbhola commented 11 months ago

See https://github.com/cockroachlabs/support/issues/2681#issuecomment-1789595737 and @mgartner's response in https://github.com/cockroachlabs/support/issues/2681#issuecomment-1791409479

Many uses of COPY will cause high write load. We could change our documentation to tell users to use background QoS https://www.cockroachlabs.com/docs/v23.1/admission-control#set-quality-of-service-level-for-a-session. However, users will forget to do this, and so will still cause problems since regular QoS is not subject to replication admission control. We could default (via a cluster setting in the SQL layer) to COPY executing at background QoS.

Jira issue: CRDB-33116

sumeerbhola commented 11 months ago

Should we also do the same for DELETE? @erikgrinaker you mentioned in https://github.com/cockroachdb/cockroach/issues/101992 that DELETE operations were causing instability.

erikgrinaker commented 11 months ago

I think we've primarily/always seen this cause problems once the txn commits and we begin resolving intents. The cluster's doing fine while the intent count increases, then it totally collapses once the intent count starts dropping.

We should be able to verify this by loading up a medium-sized cluster and doing a bulk-delete. Worth trying a bulk update too.

sumeerbhola commented 11 months ago

then it totally collapses once the intent count starts dropping

That will not happen now because intent resolution is subject to AC. But intent resolution will use the priority of the resolving txn, which if it is the txn that wrote the intent could affect foreground latency unnecessarily.

mgartner commented 11 months ago

Let's try to get this in to v23.2.

blathers-crl[bot] commented 11 months ago

Hi @michae2, please add branch-* labels to identify which branch(es) this release-blocker affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.