Skip to content

Commit

Permalink
Create four-hotels-serve.md
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Dec 4, 2023
1 parent 70091bb commit 6448fe6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/four-hotels-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@latticexyz/store-sync": major
---

Previously, all `store-sync` strategies were susceptible to a potential memory leak where the stream that fetches logs from the RPC would get ahead of the stream that stores the logs in the provided storage adapter. We saw this most often when syncing to remote Postgres servers, where inserting records was much slower than we retrieving them from the RPC. In these cases, the stream would build up a backlog of items until the machine ran out of memory.

This is now fixed by waiting for logs to be stored before fetching the next batch of logs from the RPC. To make this strategy work, we had to remove `blockLogs$` (stream of logs fetched from RPC but before they're stored) from in favor of just `storedBlockLogs$` (stream of logs fetched from RPC after they're stored).

0 comments on commit 6448fe6

Please sign in to comment.