schemachanger: remove RBR fallback for add column#140617
schemachanger: remove RBR fallback for add column#140617craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
cb71517 to
9a6b955
Compare
|
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
f288f4b to
5f1e89e
Compare
|
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
afe63bb to
da29679
Compare
da29679 to
5b0904c
Compare
71b2ee9 to
d13d41f
Compare
rafiss
left a comment
There was a problem hiding this comment.
this is super exciting!! great work.
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/ccl/schemachangerccl/testdata/end_to_end/add_column_regional_by_row/add_column_regional_by_row.definition line 2 at r1 (raw file):
setup CREATE DATABASE multiregion_db PRIMARY REGION "us-east1" REGIONS "us-east2", "us-east3" SURVIVE REGION FAILURE;
should we also have a test with SURVIVE ZONE FAILURE, or do you feel like this is sufficient?
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go line 128 at r1 (raw file):
if idx != nil { if isRBR { panicIfRegionChangeUnderwayOnRBRTable(b, "add a UNIQUE COLUMN", tbl.TableID)
nit: let's remove the if isRBR check here. panicIfRegionChangeUnderwayOnRBRTable already has that check in it.
also is the idx != nil check too broad? previously, we'd only call panicIfRegionChangeUnderwayOnRBRTable if a UNIQUE column was being added.
annrpom
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go line 128 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
nit: let's remove the
if isRBRcheck here. panicIfRegionChangeUnderwayOnRBRTable already has that check in it.also is the
idx != nilcheck too broad? previously, we'd only call panicIfRegionChangeUnderwayOnRBRTable if a UNIQUE column was being added.
re:nit -- ah oki right
re: broadness of idx != nil check -- i aligned this with legacy's implementation
cockroach/pkg/sql/add_column.go
Lines 79 to 92 in 42b9060
cockroach/pkg/sql/catalog/tabledesc/table.go
Lines 42 to 44 in 4ab689e
pkg/ccl/schemachangerccl/testdata/end_to_end/add_column_regional_by_row/add_column_regional_by_row.definition line 2 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
should we also have a test with SURVIVE ZONE FAILURE, or do you feel like this is sufficient?
i feel like this is sufficient -- at least for a DSC end_to_end test, but what were you thinking about testing? the zone config generated from a SURVIVE ZONE FAILURE (which is code i touched, but by porting it over to a new pkg) exists:
cockroach/pkg/ccl/logictestccl/testdata/logic_test/multi_region
Lines 283 to 293 in 6ebb172
if this was what you were thinking about
This patch removes the regional by row fallback for `ADD COLUMN` in the declarative schema changer. Epic: CRDB-31282 Fixes: cockroachdb#80545 Release note: None
rafiss
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @annrpom)
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go line 128 at r1 (raw file):
Previously, annrpom (annie pompa) wrote…
re:nit -- ah oki right
re: broadness of
idx != nilcheck -- i aligned this with legacy's implementation; iiuc this should still be equivalent since primary keys are also unique, but lmk if that's not what it going on herecockroach/pkg/sql/add_column.go
Lines 79 to 92 in 42b9060
cockroach/pkg/sql/catalog/tabledesc/table.go
Lines 42 to 44 in 4ab689e
that makes sense to me! thanks
pkg/ccl/schemachangerccl/testdata/end_to_end/add_column_regional_by_row/add_column_regional_by_row.definition line 2 at r1 (raw file):
Previously, annrpom (annie pompa) wrote…
i feel like this is sufficient -- at least for a DSC end_to_end test, but what were you thinking about testing? the zone config generated from a
SURVIVE ZONE FAILURE(which is code i touched, but by porting it over to a new pkg) exists:cockroach/pkg/ccl/logictestccl/testdata/logic_test/multi_region
Lines 283 to 293 in 6ebb172
if this was what you were thinking about
that is basically all i had in mind. i'm guessing the schema change plan isn't that different whether the database has REGION FAILURE or ZONE FAILURE then?
annrpom
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/ccl/schemachangerccl/testdata/end_to_end/add_column_regional_by_row/add_column_regional_by_row.definition line 2 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
that is basically all i had in mind. i'm guessing the schema change plan isn't that different whether the database has REGION FAILURE or ZONE FAILURE then?
nod nod (i verified this by rewriting the tests after modifying REGION FAILURE to ZONE FAILURE and looking at the diff as well -- the plan was the same)
|
test failure is unrelated to these changes: TFTR! ('-')7 bors r+ |
The end to end tests with DML injections we added in cockroachdb#140617, cockroachdb#139622, cockroachdb#142921 are sufficient. Epic: none Fixes: cockroachdb#136846 Release note: None
The end to end tests with DML injections we added in cockroachdb#140617, cockroachdb#139622, cockroachdb#142921 are sufficient. Epic: none Fixes: cockroachdb#136846 Release note: None
This patch removes the regional by row fallback for
ADD COLUMNin the declarative schema changer.
Epic: CRDB-31282
Fixes: #80545
Release note: None