You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
107633: sql/schemachanger: DROP INDEX could drop unrelated foreign keys r=fqazi a=fqazi
Previously, when DROP INDEX was resolving and iterating over foreign keys, it did not validate that these foreign keys were related to the index we were dropping. As a result, if any table referred back to the target table with the index, we would analyze its foreign keys. If cascade wasn't specified this could incorrectly end up blocking the DROP INDEX on unrelated foreign key references assuming they need our index. Or worse with cascade we could remove foreign key constraints in other tables. To address this, this patch filters the back references to only look at ones related to the target table, which causes the correct set to be analuzed / dropped.
Fixes: cockroachdb#107576
Release note (bug fix): Dropping an index could end up failing or cleaning foreign keys (when CASCADE is specified) on other tables referencing the target table with this index.
107646: sql: use a random minute for the sql-stats-compaction job default recurrence r=maryliag a=rafiss
### scheduledjobs: move MaybeRewriteCronExpr into package
This was moved from the schematelemetrycontroller package.
There are no code changes in this commit.
----
### sql: use a random minute for the sql-stats-compaction job default recurrence
Now, the sql-stats-compaction job that is created during cluster
initialization will be scheduled on a random minute in the hour, rather
than at the top of the hour. This will only affect clusters that are
initialized after this change is released. Any existing clusters will
continue to keep whatever recurrence they had before, which defaulted to
`@hourly.`
This change was made because we have observed that this job can cause
CPU spikes on the serverless host clusters, since different tenants all
had this job scheduled for the same time.
---
see: https://cockroachlabs.slack.com/archives/C04U1BTF8/p1688829944578639
refs: cockroachdb#54537
Epic: None
Release note: None
Co-authored-by: Faizan Qazi <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
0 commit comments