-
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
migrations: add migration to wait on in-flight schema changes #76154
migrations: add migration to wait on in-flight schema changes #76154
Conversation
ea28cff
to
56b00b4
Compare
We'd likely want to wait on this until after #73878 and until we are ready to pull the trigger on only using the new AddSStable and new backfiller. |
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 10 of 12 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @dt and @stevendanna)
pkg/migration/migrations/wait_for_schema_changes.go, line 73 at r1 (raw file):
id, ok := d.(*tree.DInt) if !ok { return errors.Newf("unexpected type for id column: %T (expected DInt)", d)
make these errors into assertion failures?
Code quote:
return errors.Newf("unexpected number of columns: %d (expected 1)", len(datums))
}
d := datums[0]
id, ok := d.(*tree.DInt)
if !ok {
return errors.Newf("unexpected type for id column: %T (expected DInt)", d)
pkg/migration/migrations/wait_for_schema_changes_test.go, line 258 at r1 (raw file):
// TODO(ssd): Some tests may succeed just // because we haven't actually started the // migrations yet. The sleep is a poor way to
plumb a channel into a testing knob?
Code quote:
// TODO(ssd): Some tests may succeed just
// because we haven't actually started the
// migrations yet. The sleep is a poor way to
// help ensure the migration starts before the
// schema change finishes.
time.Sleep(10 * time.Millisecond)
a84ac05
to
db5b216
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @ajwerner and @dt)
pkg/migration/migrations/wait_for_schema_changes.go, line 73 at r1 (raw file):
Previously, ajwerner wrote…
make these errors into assertion failures?
Done.
pkg/migration/migrations/wait_for_schema_changes_test.go, line 258 at r1 (raw file):
Previously, ajwerner wrote…
plumb a channel into a testing knob?
Done. Along with some new interval knobs to speed up the test a bit.
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.
Are we going to do this? What would we get out of it?
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @ajwerner, @dt, and @samiskin)
@ajwerner That's a good question. I wonder what @dt and @erikgrinaker think. IIRC, we wanted to do this to lower the impact of #76934. If we aren't going to do that this release, then it might be nice to not do this migration in this release and preserve the ability to flip back to the old index backfill code if we really need to. |
db5b216
to
2321ca3
Compare
5da6850
to
c63993f
Compare
0dba059
to
b2a2ea4
Compare
678e570
to
cb60960
Compare
bors r=dt |
bors cancel |
Canceled. |
854875d
to
db847b1
Compare
bors r=dt |
Build failed: |
Eventually, we want to stop accepting non-MVCC AddSSTables. To do this, we need all CREATE INDEX schema changes to use the new mvcc-compatible process. To make this more tenable, we want to drain in-flight schema changes during a migration. Release note (ops change): Finalizing an upgrade to 22.2 requires that all in-flight schema changes enter a terminal state. This may mean that finalization takes as long as the longest-running schema change.
This removes the ability to turn off MVCC-compliant index backfilling. One downside here is that we lose the roachtest that uses the old index backfiller method as a way to verify the new index backfiller. Release note (ops change): The option `sql.mvcc_compliant_index_creation.enabled` has been removed.
db847b1
to
2099121
Compare
bors r=dt |
Build failed: |
bors retry |
Build failed: |
bors retry Last two failures: |
Build succeeded: |
Eventually, we want to stop accepting non-MVCC AddSSTables. To do
this, we need all CREATE INDEX schema changes to use the new
mvcc-compatible process. To make this more tenable, we want to drain
in-flight schema changes during a migration.
Release note: Finalizing an upgrade to 22.2 requires that all
in-flight schema changes enter a terminal state. This may mean that
finalization takes as long as the longest-running schema change.
Release justification: Critical migration to ensure that 22.2's assumptions
about non-MVCC operations are true.