Skip to content

persist: panic instead of silent incorrectness on invalid usage#13618

Merged
danhhz merged 2 commits intoMaterializeInc:mainfrom
danhhz:persist_listen_bug
Jul 18, 2022
Merged

persist: panic instead of silent incorrectness on invalid usage#13618
danhhz merged 2 commits intoMaterializeInc:mainfrom
danhhz:persist_listen_bug

Conversation

@danhhz
Copy link
Copy Markdown
Contributor

@danhhz danhhz commented Jul 13, 2022

Before this commit, if a shard's since was advanced beyond the frontier
of some active listener, that listener could emit incorrect data
(compaction would also have to be quite prompt). This would be an
invalid usage by the persist user (the since shouldn't have been
advanced that far), but it's better to panic then silently emit
incorrect data. This doesn't seem to be happening in practice.

Not bothering with a regression test because the way I found this was an
upcoming branch that causes persist unit tests to deterministically
fail.

Motivation

  • This PR fixes a previously unreported bug.

Testing

  • This PR has adequate test coverage / QA involvement has been duly considered.

Release notes

This PR includes the following user-facing behavior changes:

  • N/A

@danhhz danhhz requested review from aljoscha and pH14 July 13, 2022 21:33
@danhhz
Copy link
Copy Markdown
Contributor Author

danhhz commented Jul 13, 2022

Paul mostly included you as an FYI. There's a lot of context you may not have yet on this, so don't feel the need to review (though it's welcome of course).

Copy link
Copy Markdown
Contributor

@aljoscha aljoscha left a comment

Choose a reason for hiding this comment

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

nice! 🙌

@aljoscha aljoscha self-requested a review July 14, 2022 09:28
Before this commit, if a shard's since was advanced beyond the frontier
of some active listener, that listener could emit incorrect data
(compaction would also have to be quite prompt). This would be an
invalid usage by the persist user (the since shouldn't have been
advanced that far), but it's better to panic then silently emit
incorrect data. This doesn't seem to be happening in practice.

Not bothering with a regression test because the way I found this was an
upcoming branch that causes persist unit tests to deterministically
fail.
@danhhz danhhz force-pushed the persist_listen_bug branch from c664f54 to 5808226 Compare July 18, 2022 20:50
@danhhz danhhz merged commit 6307740 into MaterializeInc:main Jul 18, 2022
@danhhz danhhz deleted the persist_listen_bug branch July 18, 2022 21:40
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