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/rowexec: make bulk row writer (materialized view/ctas) write-at-now #78563

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

dt
Copy link
Member

@dt dt commented Mar 26, 2022

Release note: none.

@dt dt requested review from erikgrinaker and ajwerner March 26, 2022 17:05
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

Not too familiar with this code, but don't we also need to change the writeTS to be around the current time, and check the version gate?

@dt
Copy link
Member Author

dt commented Mar 27, 2022

need to change the writeTS to be around the current time

I'm not following; if writeAtBatchTS is true we're just going to ignore writeTS and batchTS so why change it?

check the version gate?

I've never really understood why we needed the gate: if we just set it the request field, and let an old server ignore it because it is too old, that's the same as not setting it because the version is too old, isn't it?

@erikgrinaker
Copy link
Contributor

need to change the writeTS to be around the current time

I'm not following; if writeAtBatchTS is true we're just going to ignore writeTS and batchTS so why change it?

Yeah, I think you're right. As long as all SST timestamps are uniform and match SSTTimestampToRequestTimestamp then it's fine.

check the version gate?

I've never really understood why we needed the gate: if we just set it the request field, and let an old server ignore it because it is too old, that's the same as not setting it because the version is too old, isn't it?

I don't know the details of the bulk IO code well enough to say. If neither the old code nor the new code cares about some SSTs being written as-is and others being rewritten to the current timestamp in mixed-version clusters then it should be fine.

@dt
Copy link
Member Author

dt commented Mar 27, 2022

As long as all SST timestamps are uniform and match SSTTimestampToRequestTimestamp

If writeAtBatchTS is true, we set batchTS to now() on first key of each flush and we set key ts to batchTS (ignoring writeTS), so yeah, that'll be the case.

@dt
Copy link
Member Author

dt commented Mar 27, 2022

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 27, 2022

Build failed:

@dt
Copy link
Member Author

dt commented Mar 27, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 27, 2022

Build succeeded:

@rafiss
Copy link
Collaborator

rafiss commented Mar 27, 2022

Looks like you fixed #62932. Thanks!

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