Skip to content

Conversation

@bkirwi
Copy link
Contributor

@bkirwi bkirwi commented Nov 25, 2025

This PR fixes a bug in the flag check... we'd previously only enable write-time validation when that and the read-time validation flag were both enabled, but the code intended the opposite. (The effect of the old definition was that as soon as you relaxed the read-time checks, the behaviour of the writer would immediately change... not ideal!)

I think this was likely caused by the various "double negatives" in this code, so I made some small followup changes to avoid inverting booleans more than necessary and improving the docs a bit.

Motivation

Discovered while working on the rollout for https://github.com/MaterializeInc/database-issues/issues/9275 - I started seeing the behaviour change as soon as I flipped the read flag.

Tips for reviewer

Another odd thing is that we don't see any errors in the parallel workload: the code as written should error if the validations are ever disabled (allowing the new kind of writes) and then re-enabled (validating that no such writes exist). I'm going to try and repro that case more reliably... but it's taking a minute, so I may follow up with any changes there. I've repro'd and fixed this in the last couple commits.

@bkirwi bkirwi marked this pull request as ready for review November 25, 2025 18:53
@bkirwi bkirwi requested review from a team as code owners November 25, 2025 18:53
@bkirwi bkirwi requested review from DAlperin and petrosagg November 25, 2025 18:53
@bkirwi bkirwi requested a review from a team as a code owner November 25, 2025 21:46
@bkirwi bkirwi force-pushed the source-fixup branch 2 times, most recently from 5b1eee2 to 3443a81 Compare November 26, 2025 15:05
Copy link
Contributor

@petrosagg petrosagg left a comment

Choose a reason for hiding this comment

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

LGTM!

Reordering the if-else to avoid a double negative and adding comments.
We can get into a bad state if we toggle flags in the wrong way, and
it's best if that bad state doesn't knock over a production environment.
One of these flags allows writing stuff that the other flag would
complain about: just test the newest behaviour.
@bkirwi
Copy link
Contributor Author

bkirwi commented Nov 27, 2025

I backed out the commit that did more aggressive source timestamp intervals, since it seemed to trigger some unrelated issues in the parallel workload tests. (I'm not sure if they were test issues or real issues related to the sources, but in any case none of them were the assertion failure we're looking at in this PR.)

I still think it would be nice to test parallel workload with a wider variety of source intervals, but I'll save that for followup work.

@bkirwi bkirwi merged commit c422357 into MaterializeInc:main Nov 27, 2025
141 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.

3 participants