electric
electric copied to clipboard
Detect race condition when creating a new shape
When creating a new shape we start tracking LR stream for changes that match that shape to reconcile it with the result of initial query for the shape.
While the chances are small, it is possible that between starting a new transaction and querying the xmin
for that transaction, some transactions that have a xid
greater than xmin
might have already been processed (and dropped) at the server.
The solution discussed is to have a fixed-size buffer of transactions in Electric to be able to reconcile the shape state.