microsoft / durabletask-go

The Durable Task Framework is a lightweight, embeddable engine for writing durable, fault-tolerant business logic (orchestrations) as ordinary code.
Apache License 2.0
178 stars 25 forks source link

Support reusing orchestration id #46

Closed kaibocai closed 6 months ago

kaibocai commented 7 months ago

This PR tries to update the logic to support reuse orchestration ID, more details can be found https://github.com/microsoft/durabletask-go/issues/42, https://github.com/dapr/dapr/issues/7101 Corresponding protobuf updates can be found https://github.com/microsoft/durabletask-protobuf/pull/19

kaibocai commented 7 months ago

Draft the PR, need more tests

kaibocai commented 7 months ago

@cgillum , re-implemented the logic so it doesn't query existing instances at the beginning and most logic goes to backend implementation to utilize the isolation benefit provided by db transaction. The core logic is a little different from the pseudo-code we discussed at https://github.com/microsoft/durabletask-go/issues/42#issuecomment-1834530850, but the effect is the same and more readable.

I assume it still needs a lot of improvement and updates, but would like to get your opinion on the high-level implementation direction. Thanks.

kaibocai commented 7 months ago

tagging @ItalyPaleAle for helping review as well. Thank you Ale!