-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
rules: suppress a dep-rule in special case #87196
rules: suppress a dep-rule in special case #87196
Conversation
1. changed one comment; 2. changed one function locaiton in file to be more consistent; 3. added a code change that is consistent with the error message but won't affect correctness. Release justification:
3f65dbb
to
c112476
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, 1 of 4 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @Xiang-Gu)
pkg/sql/schemachanger/scplan/internal/rules/dep_drop_object.go
line 86 at r2 (raw file):
public.Eq(scpb.Status_PUBLIC), n.AttrEqVar(screl.CurrentStatus, public), }
Can you statically define this rules in helpers
? Also, can you make these rule names not have spaces?
Code quote:
screl.Schema.DefNotJoin1("node does not have a PUBLIC status", "n", func(n rel.Var) rel.Clauses {
public := rel.Var("public")
return rel.Clauses{
public.Eq(scpb.Status_PUBLIC),
n.AttrEqVar(screl.CurrentStatus, public),
}
})(n),
c112476
to
b38ff1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @ajwerner)
pkg/sql/schemachanger/scplan/internal/rules/dep_drop_object.go
line 86 at r2 (raw file):
Previously, ajwerner wrote…
Can you statically define this rules in
helpers
? Also, can you make these rule names not have spaces?
done!
Build failed (retrying...): |
Build failed (retrying...): |
Release justification: fixed a release blocker bug. Previously, in a mixed version state (v22.1 and v22.2), if a old node drops a rowLevelTTL table and the new shcema changer job was adopted by a new node, then there is a dep rule that cannot satisfied and hence causes forward incompatibility. This PR fixes this by suppressing this dep rule if this particular case happens (namely, it suppress the rule if `from` is Table element, `to` is a RowLevelTTL element, and there is no `PUBLIC` status of the table element anywhere in the graph). Fixes: cockroachdb#86672 Release note: None
b38ff1c
to
660efc7
Compare
Canceled. |
bors r+ |
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
blathers backport 22.2 |
Commit 1: very minor comment, function location, code changes;
Commit 2: suppress a dep-rule that causes forward incompatibility
for dropping a table with rowLevelTTL in the mixed version state.
Previously, in a mixed version state (v22.1 and v22.2), if a old node
drops a rowLevelTTL table and the new shcema changer job was adopted
by a new node, then there is a dep rule that cannot satisfied and hence
causes forward incompatibility. This PR fixes this by suppressing this
dep rule if this particular case happens (namely, it suppress the rule
if
from
is Table element,to
is a RowLevelTTL element, and there isno
PUBLIC
status of the table element anywhere in the graph).Fixes: #86672
Release note: None
Release justification: fixed a release blocker bug.