-
Notifications
You must be signed in to change notification settings - Fork 11
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
Allows use of externally owned transactions for writes #282
base: master
Are you sure you want to change the base?
Conversation
Tagged Cloud PT, https://octopusdeploy.slack.com/archives/C01Q95KPRM4/p1709254205324879
|
I'm not following this. Previously The new I'm confused. |
You are totally right, I got myself confused while trying to use the MS convention on TryXXX methods... To not make this a breaking change I'll have to not use this convention |
This pull request has been linked to Shortcut Story #71481: Get agreement with PET regarding shared transaction between NSB and Nevermore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking this one for further discussion.
void CommitIfOwned(); | ||
Task CommitIfOwnedAsync(CancellationToken cancellationToken = default); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the feedback on https://github.com/OctopusDeploy/OctopusDeploy/pull/23120, we'd rather not introduce a different way to commit a Nevermore transaction. Rather, the consumer (Octopus Server) should be aware of whether the SQL transaction is externally owned and simply not call Commit()
on the Nevermore transaction in that case. Happy to assist with ways to solve that.
Nevermore already had the concept of accepting an external transaction to use for reads. This PR extends that behaviour to writes.
Commit()
was renamed toTryCommit()
to convey that it can now throw an exception if the externally provided transaction has already been committed elsewhere. This caused a lot of noise in the tests but I think the rename is valuable otherwise this would be a breaking change.[sc-71481]