Skip to content

Instantly share code, notes, and snippets.

@msirek
Created March 22, 2022 05:33
Show Gist options
  • Save msirek/c2cfae90384fa4a398e8ad727dda5e59 to your computer and use it in GitHub Desktop.
Save msirek/c2cfae90384fa4a398e8ad727dda5e59 to your computer and use it in GitHub Desktop.
Mutation checking loop re-checks the cluster setting on each iteration.
for tableID, rowsAffected := range mutationCounts {
// Check the cluster setting and table setting before each refresh
// in case it was disabled recently.
var enabledForTable bool
if enabled, ok := autoStatsEnabledForTable[tableID]; ok {
if !enabled {
break
}
enabledForTable = true
} else if !AutomaticStatisticsClusterMode.Get(&r.st.SV) {
if len(autoStatsEnabledForTable) == 0 {
break
} else {
continue
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment