microsoft / durabletask-mssql

Microsoft SQL storage provider for Durable Functions and the Durable Task Framework
MIT License
87 stars 32 forks source link

Fix continue-as-new data corruption issue #150

Closed cgillum closed 1 year ago

cgillum commented 1 year ago

Fixes #146

An issue was discovered where certain message payloads were being lost in certain situations. The root cause ended up being overaggressive purge logic in the SQL stored procedures when an orchestration (or entity) does a ContinueAsNew.

This PR updates the ContinueAsNew T-SQL logic to be more selective in what data it deletes to ensure that unprocessed events are not impacted. This PR also adds a new test-case that was previously able to reproduce the issue reliably.