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

Feature/graceful reconfig until ready sql #28821

Conversation

jubrad
Copy link
Contributor

@jubrad jubrad commented Aug 5, 2024

Motivation

Adds SQL parsing for ALTER CLUSTER ... WITH ( WAIT UNTIL READY=(<options>) )
where options are TIMEOUT=<duration> and ON TIMEOUT=<COMMIT|ROLLBACK>

https://github.com/MaterializeInc/database-issues/issues/5976

This PR is stacked on the following PRs

This was formerly known as until caught up but the language has been changed to until ready for both clarity and to allow us to shift the definition of "ready" internally for this feature without needing to add new sql changes.

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch 2 times, most recently from 4639d4c to 5b7528d Compare August 7, 2024 04:26
@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch 5 times, most recently from a91cb8a to 35e8a48 Compare August 16, 2024 16:20
@jubrad jubrad marked this pull request as ready for review August 16, 2024 16:20
@jubrad jubrad requested a review from a team as a code owner August 16, 2024 16:20
@jubrad jubrad requested a review from jkosh44 August 16, 2024 16:20
@jubrad jubrad changed the title Feature/graceful reconfig until caught up sql Feature/graceful reconfig until ready sql Aug 16, 2024
@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch from 35e8a48 to 843d31c Compare August 16, 2024 16:22
Copy link
Contributor

@jkosh44 jkosh44 left a comment

Choose a reason for hiding this comment

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

LGTM modulo a couple small comments

src/sql-parser/tests/testdata/ddl Outdated Show resolved Hide resolved
src/sql/src/plan/statement/ddl.rs Outdated Show resolved Hide resolved
src/sql-parser/src/ast/defs/statement.rs Outdated Show resolved Hide resolved
@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch 2 times, most recently from cb5a83c to ead5646 Compare August 16, 2024 18:24
Copy link
Member

@benesch benesch left a comment

Choose a reason for hiding this comment

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

So good!

@@ -739,6 +740,9 @@ impl fmt::Display for PlanError {
},
Self::SubsourceResolutionError(e) => write!(f, "{}", e),
Self::Replan(msg) => write!(f, "internal error while replanning, please contact support: {msg}"),
Self::UntilReadyTimeoutRequired => {
write!(f, "TIMEOUT=<duration> option is required for ALTER CLUSTER ... WITH ( WAIT UNTIL READY ( ... ) )")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
write!(f, "TIMEOUT=<duration> option is required for ALTER CLUSTER ... WITH ( WAIT UNTIL READY ( ... ) )")
write!(f, "TIMEOUT=<duration> option is required for ALTER CLUSTER ... WITH (WAIT UNTIL READY ( ... ))")

@@ -4894,6 +4901,9 @@ pub fn plan_alter_cluster(
&crate::session::vars::ENABLE_GRACEFUL_CLUSTER_RECONFIGURATION,
)?;
}
AlterClusterPlanStrategy::UntilReady { .. } => {
bail_unsupported!("ALTER CLUSTER .. WITH ( WAIT UNTIL READY...) is not yet implemented");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bail_unsupported!("ALTER CLUSTER .. WITH ( WAIT UNTIL READY...) is not yet implemented");
bail_unsupported!("ALTER CLUSTER .. WITH (WAIT UNTIL READY...) is not yet implemented");

@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch from ead5646 to fff87dd Compare August 16, 2024 21:01
@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch from fff87dd to 1594d23 Compare August 18, 2024 18:58
add ddl for wait until ready,
keeps feature disabled/unimplemented.
@jubrad jubrad force-pushed the feature/graceful-reconfig-until-caught-up-sql branch from 1594d23 to ed90d44 Compare August 18, 2024 18:59
Copy link
Member

@benesch benesch left a comment

Choose a reason for hiding this comment

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

New COMMIT vs ROLLBACK syntax LGTM.

Copy link
Contributor

@morsapaes morsapaes left a comment

Choose a reason for hiding this comment

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

Thanks, @jubrad! Linking to the SQL Council thread for posterity.

@jubrad jubrad merged commit 1bac85c into MaterializeInc:main Aug 19, 2024
80 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants