materialize icon indicating copy to clipboard operation
materialize copied to clipboard

[WIP] persist: upsert cas / read latest state as single query

Open pH14 opened this issue 1 year ago • 2 comments

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

pH14 avatar Aug 03 '22 21:08 pH14

Cockroach change merged!

maddyblue avatar Aug 08 '22 18:08 maddyblue

Amazing! Thank you Matt 🙇

pH14 avatar Aug 08 '22 19:08 pH14

A rebase will fix the test failure.

maddyblue avatar Aug 15 '22 17:08 maddyblue

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

pH14 avatar Aug 15 '22 19:08 pH14