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

sql/schemachanger: infrastructure for supporting CREATE statements #104348

Closed
wants to merge 2 commits into from

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Jun 5, 2023

To support CREATE statements, we need to be able to do multiple transitions for elements in a single stage. To help support this, this patch will add the following:

  • Add support for limiting rules to a maximum phase, which allows us to create ones that will only impact the statement phase
  • Add a statement phase rule that only allows a single transition for non-added descriptors
  • Modify the two version invariant to not apply to added descriptors.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@fqazi fqazi marked this pull request as ready for review June 5, 2023 17:42
@fqazi fqazi requested a review from a team as a code owner June 5, 2023 17:42
Copy link
Contributor

@postamar postamar left a comment

Choose a reason for hiding this comment

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

I like this, the general idea is sound. I'm concerned about how many rules this adds, but that wouldn't be a dealbreaker if unavoidable. See my only non-nit comment.

Previously, we had code inside the stage builder to enforce
that only a single transition was allowed per-statement phase.
This would have made it hard to implement CREATE statements
since we need to apply multiple transitions. To address this,
this patch adds dep rules to limit the number of transitions,
which will be later disabled for create statements. To help
support this a new precedence type is introduced.

Epic: none
Release note: None

merge to 0
<pkg>: <short description - lowercase, no final period>

<what was there before: Previously, ...>
<why it needed to change: This was inadequate because ...>
<what you did about it: To address this, this patch ...>
Previously, the two version invariant was enforced
for all non-dropped descriptors. When creating new
descriptors if they are going to be decomposed into
individual elements, then similar logic needs to
skip added descriptors. To address this, this patch
disables these rules for added descriptors.

Epic: none

Release note: None
@postamar
Copy link
Contributor

Is this PR superseded by #104350 at this point?

@fqazi
Copy link
Collaborator Author

fqazi commented Jun 12, 2023

@postamar This is superseded, killing this one off.

@fqazi fqazi closed this Jun 12, 2023
craig bot pushed a commit that referenced this pull request Jun 29, 2023
104350: sql/schemachanger: support for create sequence inside the declarative schema changer r=fqazi a=fqazi

This patch implements CREATE SEQUENCE in the declarative schema changer. The first three commits can be ignored and are included in (#104348, which should be reviewed and merged first). This patch will:

- Skip validation/backfill for descriptors in an added state
- Fixes prefix resolution creating new objects, where two-part names were not handled properly before
- Adds support for CREATE sequence in the declarative schema changer

Fixes: #104351

105454: roachtest: update `mixedversion` to always use secure clusters r=srosenberg a=renatolabs

Secure clusters are closer to production deployments and also allow
us to tests features that we couldn't before, like creating new users
with passwords during a test, and then performing SQL operations with
those users.

In the process of getting this to work, there were a few bugs that needed
to be fixed (first commit), and the `cluster` interface needed a small update
as well (second commit).

Epic: CRDB-19321

Release note: None

105765: ui: fix db page Node/Regions column rendering r=xinhaoz a=xinhaoz

Previously, the db page was not updating its columns if the
`showNodeRegionsColumn` prop changed. The db details page was
also not filtering out the regions column when desired.

Epic: none

Release note (bug fix): node/regions columns in db and db details
page should properly render. This column is hidden for tenants and
otherwise is shown for clusters with > 1 node.

105770: persistedsqlstats: skip TestSQLStatsPersistedLimitReached under stress r=zachlite a=zachlite

TestSQLStatsPersistedLimitReached succeeds under 'normal' testing conditions. We can and should get this test coverage when we can.

Informs #97488
Epic: none
Release note: None

105799: kv: expose env var to configure raft entry cache size r=erikgrinaker a=nvanbenschoten

Informs #98666.

This commit introduces a new `COCKROACH_RAFT_ENTRY_CACHE_SIZE` which can be used to configure the size of the raft entry cache. The default value is 16 MiB.

Release note: None

Co-authored-by: Faizan Qazi <faizan@cockroachlabs.com>
Co-authored-by: Renato Costa <renato@cockroachlabs.com>
Co-authored-by: Xin Hao Zhang <xzhang@cockroachlabs.com>
Co-authored-by: zachlite <zachlite@gmail.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
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.

None yet

3 participants