Skip to content
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

*: enable declarative schema changer #76944

Merged
merged 17 commits into from
Feb 24, 2022

Conversation

postamar
Copy link
Contributor

This change enables the declarative schema changer by default. This PR originated as #76610 by @fqazi which I rebased following the merging of #76776. Only mild alterations were needed, these commits can therefore be considered as having been reviewed.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@postamar postamar force-pushed the enable-declarative-schema-changer branch from e43ce18 to 79c1178 Compare February 24, 2022 03:32
@postamar postamar marked this pull request as ready for review February 24, 2022 03:33
@postamar postamar requested a review from a team February 24, 2022 03:33
@postamar postamar requested a review from a team as a code owner February 24, 2022 03:33
@postamar postamar requested a review from a team February 24, 2022 03:33
@postamar postamar requested review from a team as code owners February 24, 2022 03:33
@postamar postamar requested review from shermanCRL and removed request for a team and shermanCRL February 24, 2022 03:33
@postamar postamar force-pushed the enable-declarative-schema-changer branch 2 times, most recently from 6237a46 to 7904823 Compare February 24, 2022 04:22
Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 11 of 23 files at r1, 56 of 56 files at r14, 2 of 2 files at r15, 6 of 6 files at r16, 1 of 1 files at r17, 10 of 10 files at r18, 2 of 2 files at r19, 1 of 1 files at r20, 8 of 8 files at r21, 11 of 11 files at r22, 5 of 5 files at r23, 17 of 17 files at r24, 1 of 1 files at r25, 1 of 1 files at r26, 11 of 11 files at r27, 38 of 38 files at r28, 3 of 3 files at r29, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @postamar)

@postamar postamar force-pushed the enable-declarative-schema-changer branch from 7904823 to f27d76a Compare February 24, 2022 05:45
@postamar
Copy link
Contributor Author

Thanks for the review! I bumped the TESTIMEOUT variable in the Makefile to 60 minutes, evidently 50 minutes instead of the original 45 doesn't cut it either. We can worry about this later.

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 24, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Feb 24, 2022

Build failed:

ajwerner and others added 6 commits February 24, 2022 06:36
Previously, the declarative schema changer fetched information
about tables in the transaction for ALTER TABLE before checking
if the commands were supported. This was problematic because
it could change timing/retry behaviour in certain cases, since
we would do potentially extra descriptor look ups. To address this,
this patch checks if ALTER TABLE commands are supported first
to avoid intermittent failures caused by extra round trips.

Release note: None
Previously, the declarative schema changer was disabled
by default. We are enabling it by default, so some logic
test updates are needed. This patch will update logictest
expected files.

Release note: None
Previously, the declarative schema changer did not return
the correct error when attempting to modify pg_catalog
tables. To address this, this patch will return the correct
error when trying to modify pg_catalog tables.

Release note: None
Previously, the declarative schema changer was enabled
by default, which could cause certain tests designed
for the legacy schema changer to fail. To address this,
this patch individual disables declarative schema changer
on tests designed for legacy schema changer.

Release note: None
Previously, the message generated for drop types that
were not allowed due to dependencies was had a period.
This patch will update the message to match the legacy
schema changer.

Release note: None
fqazi and others added 11 commits February 24, 2022 06:36
Previously, the declarative schema changer did not generate
the correct messages when attempting to drop/alter multiregion
enums. To address this patch will update the message generated
for multiregion enums to include a hint to indicate that ALTER
DATABASE should be used for such modifications.

Release note: None
Previously, the declarative schema changer did not
support KV tracing. This was inadequate because the
legacy schema changer supported this functionality
which is needed for supportability of the product.
To address this, this patch will add support for
KV tracing inside the declarative schema changer.

Release note: None
Previously, when dropping a database descriptor, the
decalrative schema changer never deleted database
descriptors properly. This led to the descriptors being
left behind, instead of fully being cleaned up. To address,
this patch will delete database descriptors during DROP
DATABASE.

Release note: None
Previously, the declarative schema changer did not
populate the drop time when dropping tables. This
could be problematic when looking at crdb_internal tables
and other scenarios that detect if a table is dropped
based on this time. To address this, this patch starts
populating the DropTime inside the declarative schema changer.

Release note: None
This commit ensures that the declarative schema changer properly
increments telemetry counters.

Release note: None
Previously, there the enums logictest with the declarative schema
changer code paths enabled could intermittently fail with retry
errors. The design of the test is such that we execute SELECT
queries and schema changes in the same transaction, so automatic
retries are not possible once the result set has been sent
to the client. To address this, this patch will workaround the
issue by disabling declarative schema changer for this test.

Release note: None
Previously, we were right at the timeout boundary
for the TenantLogicTest. With the declarative schema
changer enabled we are just past the 45 minute mark causing
this test to fail. This patch bumps up the test timeout to 50
minutes to allow for breathing room.

Release note: None
This commit adds more data-driven tests to cover CCL features support by
the declarative schema changer.

Release note: None
This commit replaces the scpb.TableLocality element with its four
constituent subtypes:
 - global,
 - regional by row,
 - regional by table in the primary region,
 - regional by table in another region,

The last of these is special in that it holds a reference to the
multi-region enum type ID. Removing it therefore entails removing the
back-reference to the table in the type descriptor.

Release note: None
This test was failing due to the declarative schema changer's GC job
name being different from that of the legacy schema changer's.

Release note: None
This is now superfluous, as the declarative schema changer is enabled by
default.

Release note: None
@postamar postamar force-pushed the enable-declarative-schema-changer branch from f27d76a to 3a05e87 Compare February 24, 2022 11:42
@postamar
Copy link
Contributor Author

I added a commit which removes the local-declarative-schema logic test config, it's entirely useless now. Perhaps this will help merge this. We've had a flake and then a timeout, while the branch CI actually passed this time.

@postamar
Copy link
Contributor Author

postamar commented Feb 24, 2022

Hmm the more I look into it, the more those bors failures seem like unrelated flakes. I feel like a baby trying to ram a square peg through a round hole and not understanding why it's not going through, but...

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 24, 2022

Build succeeded:

@craig craig bot merged commit 5b42a98 into cockroachdb:master Feb 24, 2022
@postamar
Copy link
Contributor Author

Oh, what a relief. It's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants