-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql/catalog/lease: Avoid cross descriptor validation when acquiring leases #95764
Comments
I think for the code we have today, this is reasonable. Cross-reference validation doesn't buy us much other than awareness of existing corruption at a time you don't really want to know about it. However, there might be value in cross-reference validation if we used it to determine minimum versions of referenced descriptors and used that to bootstrap cross-descriptor coherence in our caching. That's a bigger topic for a document I have brewing. |
@fqazi if you haven't actively done anything here, I think we ought to deprioritize this. There's questions about the mechanism. In light of recent discoveries that this was not the root cause of the motivating customer issue, I'm not sure how much this matters. |
Nothing has been actively done on this issue, we can deprioritize this one. The other thing is if cross-descriptor validation is important during leasing we could also move to a sampled model, we don't have to do this stuff on every renewal. |
Fixes: cockroachdb#95764 Previously, when renewing a lease we would fetch dependent descriptors for cross-descriptor validation. This could lead to perpetual transaction retries, in the schema where there are tons of dependencies between descriptors since lease renewals would happen in a high-priority transaction. Additionally, this incurs additional latency for lease renewal. To address this, this patch disables cross-validation by default for lease renewals. Epic: none Release note (bug fix): Disable cross-descriptor validation on lease renewal, which can lead to transactions getting pushed during schema changes on a multi-region cluster.
97630: sql/lease: support skipping descriptor validation lease renewals r=fqazi a=fqazi Fixes: #95764 Previously, when renewing a lease we would fetch dependent descriptors for cross-descriptor validation. This could lead to perpetual transaction retries, in the schema where there are tons of dependencies between descriptors since lease renewals would happen in a high-priority transaction. Additionally, this incurs additional latency for lease renewal. To address this, this patch disables cross-validation by default for lease renewals. Epic: none Release note (bug fix): Disable cross-descriptor validation on lease renewal, which can be problematic when there are lots of descriptors with lots of foreign key references, in which cases, the cross-reference validation could starve schema changes. Co-authored-by: Faizan Qazi <[email protected]>
Fixes: cockroachdb#95764 Previously, when renewing a lease we would fetch dependent descriptors for cross-descriptor validation. This could lead to perpetual transaction retries, in the schema where there are tons of dependencies between descriptors since lease renewals would happen in a high-priority transaction. Additionally, this incurs additional latency for lease renewal. To address this, this patch disables cross-validation by default for lease renewals. Epic: none Release note (bug fix): Add support for disabling cross-descriptor validation on lease renewal, which can be problematic when there are lots of descriptors with lots of foreign key references, in which cases, the cross-reference validation could starve schema changes. This can be enabled with sql.catalog.descriptor_lease_renewal_cross_validation.
Will close this once the backports are merged. |
Previously, when renewing a lease we would fetch dependent descriptors for cross-descriptor validation. This could lead to perpetual transaction retries, in the schema where there are tons of dependencies between descriptors since lease renewals would happen in a high-priority transaction. Additionally, this incurs additional latency for lease renewal. To address this, this patch disables cross-validation by default for lease renewals. Epic: none Release note (bug fix): Add support for disabling cross-descriptor validation on lease renewal, which can be problematic when there are lots of descriptors with lots of foreign key references, in which cases, the cross-reference validation could starve schema changes. This can be enabled with sql.catalog.descriptor_lease_renewal_cross_validation.
All backports are merged |
Previously, when renewing a lease we would fetch dependent descriptors for cross-descriptor validation. This could lead to perpetual transaction retries, in the schema where there are tons of dependencies between descriptors since lease renewals would happen in a high-priority transaction. Additionally, this incurs additional latency for lease renewal. To address this, this patch disables cross-validation by default for lease renewals. Epic: none Release note (bug fix): Add support for disabling cross-descriptor validation on lease renewal, which can be problematic when there are lots of descriptors with lots of foreign key references, in which cases, the cross-reference validation could starve schema changes. This can be enabled with sql.catalog.descriptor_lease_renewal_cross_validation.
Previously, we added support for disabling descriptor lease validation during lease renewal to avoid regressions due to the overhead on multi-region clusters, where in some cases schema change transactions would hit retry errors. This was inadequate because the default still exposed users to a regression in behaviour. To address this, this patch will disable cross-descriptor validation by default during lease renewal. Informs: cockroachdb#95764 Release note: None
Previously, we added support for disabling descriptor lease validation during lease renewal to avoid regressions due to the overhead on multi-region clusters, where in some cases schema change transactions would hit retry errors. This was inadequate because the default still exposed users to a regression in behaviour. To address this, this patch will disable cross-descriptor validation by default during lease renewal. Informs: cockroachdb#95764 Release note: None
As part of the lease acquisition process, we utilize high-priority transactions, which can cause cross-descriptor validation to potentially push out other work such as schema changes. In a schema where a single table has tons of foreign key references, this validation on a sizeable multi-region cluster could lead to a fairly high frequency of such events. Cross-descriptor validation is only strictly needed at modification time, and our approach of aggressively doing it for even reads can have a determinantal impact in certain cases by blocking schema changes (on lease renewals).
Jira issue: CRDB-23721
The text was updated successfully, but these errors were encountered: