anthonysharpy / sandbank

Sandbank is the easy-to-use database for s&box.
Other
8 stars 0 forks source link

Stale Documents Cache May Overwrite Itself In The Wrong Order #65

Open anthonysharpy opened 1 week ago

anthonysharpy commented 1 week ago

We store stale documents in a ConcurrentBag. However, we don't enforce that that same document is not stored twice. Not only that, but ConcurrentBag is unordered. So in really specific scenarios, an older version of a document may overwrite a newer version of a document when the stale documents are saved to disk. This is not really a big deal, as this would usually be overwritten again immediately by a correct version, but could cause issues in really really specific circumstances

anthonysharpy commented 1 week ago

This also arguably leads to performance issues, as it creates unnecessary writes