Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find existing saga data when the assembly version changes #49

Open
xhafan opened this issue Oct 30, 2024 · 3 comments
Open

Could not find existing saga data when the assembly version changes #49

xhafan opened this issue Oct 30, 2024 · 3 comments

Comments

@xhafan
Copy link

xhafan commented Oct 30, 2024

I have a long running saga, with saga_type DB field containing an assembly version, example value: Core.Rebuses.SagaCommandData``1[[.Core.Features.Commands.SomeCommand, Core, Version=2.0.0.4195, Culture=neutral, PublicKeyToken=null]]. There is a deployment during a long running saga, the assembly version changes, and it can no longer find the saga, I can see the message Could not find existing saga data for message... in the output.

I was able to hack-fix it by removing the version from the saga-type, the value above would become: Core.Rebuses.SagaCommandData``1[[.Core.Features.Commands.SomeCommand, Core, Culture=neutral, PublicKeyToken=null]]. That works for me.

I can see Rebus.SqlServer contains ISagaTypeNamingStrategy, which looks like a solution for this issue. Unfortunately is does not exist in Rebus.PostgreSql.

xhafan added a commit to SmartGuideApp/Rebus.PostgreSql that referenced this issue Oct 30, 2024
…ion changes - removing version from saga type
@mookid8000
Copy link
Member

Hi @xhafan , thanks for your PR!

I'm reluctant to merge your PR as it is, because it's a subly, but clearly breaking change – e.g. consider what would happen if someone out there actually relied on the fact that incrementing the version number would make the saga data incompatible with previously serialized instances.

Having it as a pluggable strategy is definitely the correct way to solve this.

Would it be possible for you to crank it up a notch and port the ISagaTypeNamingStrategy to the Rebus.PostgreSql repo too? 🙂

@Buthrakaur
Copy link

Hi @mookid8000 , shouldn't than ISagaTypeNamingStrategy be part of the core Rebus library instead of copying this from one Rebus persistence sub-library to another?

@mookid8000
Copy link
Member

@Buthrakaur That has been considered before, but the thing is that not all saga persisters need such a thing... even though it wouldn't hurt anything if it was part of core Rebus, it just wouldn't be used e.g. for MongoDB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants