-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Log Events for Alter Table, Async Schema Change #7571
Conversation
Sorry you had to learn about this the hard way :( Reviewed 9 of 9 files at r1. sql/alter_table.go, line 246 [r1] (raw file):
this comment isn't useful =/ sql/event_log.go, line 44 [r1] (raw file):
none of the others reference a specific syntax. In fact, I think we run through AlterTable on sql/lease.go, line 340 [r1] (raw file):
Slightly less code duplication:
sql/schema_changer.go, line 520 [r1] (raw file):
you might want to sql/testdata/event_log, line 263 [r1] (raw file):
remove Comments from Reviewable |
Review status: all files reviewed at latest revision, 7 unresolved discussions, all commit checks successful. sql/event_log.go, line 49 [r1] (raw file):
s/reverse/reversing sql/event_log.go, line 52 [r1] (raw file):
s/finish/finished Comments from Reviewable |
Review status: all files reviewed at latest revision, 7 unresolved discussions, all commit checks successful. sql/event_log.go, line 49 [r1] (raw file):
|
Review status: all files reviewed at latest revision, 7 unresolved discussions, all commit checks successful. sql/event_log.go, line 49 [r1] (raw file):
|
Commit adds three new event log types: + "Alter Table", logged for every ALTER TABLE DDL statement. + "Finish Schema Change", logged when an asynchronous schema change is completed. + "Reverse Schema Change", logged when an asynchronous schema change encounters an error (such as a constraint violation during backfill) and is rolled back. This Commit encountered an interesting, perhaps unintended effect with `SystemConfigTrigger`: in a "mixed" transaction which updates both system and non-system keys, the system changes will only be gossiped if the transaction record is located on the system range. In other words, "mixed" transactions will only work correctly if the system keys are modified first. Issue cockroachdb#7570 had been logged to track this unexpected behavior; this commit has also added a number of comments and a logged error to address this.
b71e9d8
to
bde7d24
Compare
Review status: 1 of 9 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. sql/alter_table.go, line 246 [r1] (raw file):
|
Review status: 1 of 9 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. sql/lease.go, line 340 [r1] (raw file):
|
Reviewed 8 of 8 files at r2. sql/alter_table.go, line 246 [r1] (raw file):
|
advance() should use rs.req.Entries[0].Data as the context instead of req.Context for deletion. Since req.Context is never set, there won't be any context being deleted from pendingReadIndex; results mem leak. FIXES cockroachdb#7571
Commit adds three new event log types:
completed.
an error (such as a constraint violation during backfill) and is rolled back.
This Commit encountered an interesting, perhaps unintended effect with
SystemConfigTrigger
: in a "mixed" transaction which updates both system andnon-system keys, the system changes will only be gossiped if the transaction
record is located on the system range. In other words, "mixed" transactions will
only work correctly if the system keys are modified first. Issue #7570 had been
logged to track this unexpected behavior; this commit has also added a number of
comments and a logged error to address this.
This change is