Skip to content
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

opt: clarify plan gist comment #84849

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pkg/sql/opt/exec/explain/plan_gist_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ import (

func init() {
if numOperators != 58 {
// If this error occurs please make sure the new op is the last one in order
// to not invalidate existing plan gists/hashes. If we are just adding an
// operator at the end there's no need to update version below and we can
// just bump the hardcoded literal here.
// This error occurs when an operator has been added or removed in
// pkg/sql/opt/exec/explain/factory.opt. If an operator is added at the
// end of factory.opt, simply adjust the hardcoded value above. If an
// operator is removed or added anywhere else in factory.opt, increment
// gistVersion below. Note that we currently do not have a mechanism for
// decoding gists of older versions. This means that if gistVersion is
// incremented in a release, upgrading a cluster to that release will
// cause decoding errors for any previously generated plan gists.
panic(errors.AssertionFailedf("Operator field changed (%d), please update check and consider incrementing version", numOperators))
}
}
Expand Down