-
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
sql/schemachanger/scplan: allow plan to move to NonRevertible earlier #84430
sql/schemachanger/scplan: allow plan to move to NonRevertible earlier #84430
Conversation
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.
LGTM but please that can-still-fail determining logic to opgen as suggested, it should be quite straightforward to do.
return aID < bID | ||
}), | ||
} | ||
}) |
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.
FWIW I'm totally fine with these, they are well-motivated and easy to understand.
rec(n) | ||
} | ||
return m | ||
} |
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.
Ah. This makes sense.
This logic belongs in the bowels of opgen, though, along with what determines the revertible
boolean field on each op-edge. You'll find that it's quite similar.
In fact, perhaps this revertible
boolean field should be replaced by an enum with three states:
- revertible, failure possible;
- revertible, failure not possible;
- not revertible, failure not possible.
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.
I moved this into opgen in the newly added first commit. It was the right thing to do, but took a little bit of elbow grease.
I've left two booleans as I found it easier to deal with for now, do you feel strongly?
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.
No, I don't feel strongly about that.
38b09d6
to
f54a672
Compare
This change reworks opgen to require the emit functions to specify the type of op they'll emit. This allows us to statically determine the op type and then use that to determine whether there are any remaining ops which might fail. Release note: None
f54a672
to
21a4021
Compare
This is critical for DROP COLUMN. In `DROP COLUMN` we cannot perform the primary index swap until the dropping column reaches `DELETE_ONLY`, which is not revertible. The primary index swap itself is revertible. Given this fact, we need a mechanism to be able to "promote" revertible operations (operations which don't destroy information or cause irrevocable visible side effects) to be grouped with or after non-revertible operations. This commit makes that happen naturally. Release note: None
21a4021
to
20acd12
Compare
bors r+ |
Build succeeded: |
This is critical for DROP COLUMN. In
DROP COLUMN
we cannot perform theprimary index swap until the dropping column reaches
DELETE_ONLY
, which isnot revertible. The primary index swap itself is revertible. Given this fact,
we need a mechanism to be able to "promote" revertible operations (operations
which don't destroy information or cause irrevocable visible side effects) to
be grouped with or after non-revertible operations. This commit makes that
happen naturally.
Release note: None