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: Add columnar format to HollowBatchPart #27800

Merged

Conversation

ParkMyCar
Copy link
Member

@ParkMyCar ParkMyCar commented Jun 21, 2024

This PR adds the format of a Part (e.g. Row or RowAndColumnar) to the HollowBatchPart, so our format is observable from CRDB state without having to read a blob.

Dan originally mentioned adding this to HollowBatch, which I tried but it seems like we might concat the parts from multiple batches into a single batch, which creates the possibility for a single Batch to contain Parts with different formats.

@bkirwi I'm not sure what our stability guarantees are for HollowBatchPart. I added this in a way that should be backwards and forwards compatible, but please double check me here

Motivation

  • This PR adds a known-desirable feature.

Making columnar format observable from State, follow-up from #26561 (review)

Checklist

@ParkMyCar ParkMyCar marked this pull request as ready for review June 24, 2024 17:35
@ParkMyCar ParkMyCar requested a review from a team as a code owner June 24, 2024 17:35
Copy link
Contributor

@bkirwi bkirwi left a comment

Choose a reason for hiding this comment

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

Overall looks good, but I think you may indeed have a backcompat problem - at a glance roundtripping between versions seems like it may lose the new field. Approving assuming you can either add a dyncfg or convince yourself it's not a real problem...

Some(cfg.batch_columnar_format)
} else {
None
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may fail to roundtrip during upgrade, if a batch with a columnar format is written by a new version but retracted by the old version without the proto change.

This is probably fine iff no environments currently have the new columnar format enabled, but otherwise you may want an additional flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense! I think adding a second flag to control the writing is easier to reason about so I updated the PR to do that

@ParkMyCar ParkMyCar requested a review from a team as a code owner June 26, 2024 21:51
@ParkMyCar ParkMyCar force-pushed the persist/save-columnar-version branch from a38c6e9 to 22e3f91 Compare June 27, 2024 00:14
@ParkMyCar ParkMyCar enabled auto-merge (squash) June 27, 2024 00:41
@ParkMyCar ParkMyCar merged commit 38802e6 into MaterializeInc:main Jun 27, 2024
184 of 195 checks passed
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.

2 participants