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

persist: Allow appending Datum::Null to Codec Row data #29234

Merged

Conversation

ParkMyCar
Copy link
Member

This PR does two things:

  1. Allows pushing Datum::Null onto Codec Row data when columns are missing
  2. Gates Persist schema evolution, specifically compare_and_evolve_schema, behind a scary dyncfg.

We should never enable this dyncfg in staging or prod until compaction can handle data that is written in different schemas, but I'm putting it up because it helps me test ALTER TABLE end-to-end. @danhhz and I chatted about this here

Motivation

Small progress towards ALTER TABLE

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.

* allow pushing Datum::Null onto Codec Row data when columns are missing
* gate Persist schema evolution behind a scary dyncfg
@ParkMyCar ParkMyCar requested a review from danhhz August 26, 2024 22:57
@ParkMyCar ParkMyCar marked this pull request as ready for review August 26, 2024 22:57
@ParkMyCar ParkMyCar requested review from a team as code owners August 26, 2024 22:57
@@ -639,6 +649,10 @@ impl PersistClient {
T: Timestamp + Lattice + Codec64,
D: Semigroup + Codec64 + Send + Sync,
{
if !DANGEROUS_ENABLE_SCHEMA_EVOLUTION.get(&self.cfg.configs) {
panic!("tried to evolve the schema of a Persist shard without the feature enabled");
Copy link
Member Author

Choose a reason for hiding this comment

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

We could return an error here instead of panicking, but because this should never get called in Prod I figured panicking was better. Happy to change though!

Copy link
Contributor

Choose a reason for hiding this comment

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

Panic seems great to me

"persist_dangerous_enable_schema_evolution",
false,
"\
DANGEROUS DO NOT ENABLE IN PRODUCTION ENVIRONMENTS!
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: OR STAGING

Copy link
Member Author

Choose a reason for hiding this comment

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

Added!

@@ -639,6 +649,10 @@ impl PersistClient {
T: Timestamp + Lattice + Codec64,
D: Semigroup + Codec64 + Send + Sync,
{
if !DANGEROUS_ENABLE_SCHEMA_EVOLUTION.get(&self.cfg.configs) {
panic!("tried to evolve the schema of a Persist shard without the feature enabled");
Copy link
Contributor

Choose a reason for hiding this comment

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

Panic seems great to me

@ParkMyCar ParkMyCar enabled auto-merge (squash) August 27, 2024 14:27
@ParkMyCar ParkMyCar merged commit 808b91c into MaterializeInc:main Aug 27, 2024
81 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 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.

2 participants