materialize
materialize copied to clipboard
[WIP] persist: upsert cas / read latest state as single query
Still WIP... saw that we're getting cas mismatches on ~40-50% of our compare_and_set
calls steady-state. This rewrites the query so we can both insert || read the latest state before retrying, in case of cas mismatch.
This is unmergeable until https://github.com/MaterializeInc/materialize/pull/13954 and a good round of Maelstrom testing
Motivation
Tips for reviewer
Checklist
-
[ ] This PR has adequate test coverage / QA involvement has been duly considered.
-
[ ] This PR evolves an existing
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way) and therefore is tagged with aT-protobuf
label. -
[ ] This PR includes the following user-facing behavior changes:
Cockroach change merged!
Amazing! Thank you Matt 🙇
A rebase will fix the test failure.
Downgraded the interesting-ness of this PR a bit. I couldn't find a way to fast-path-insert-or-read in a single RTT to CRDB, and I removed the pipeline read for now -- we can reexamine what our contention looks like post-https://github.com/MaterializeInc/materialize/pull/14217