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

Implicit Collection transactions aren't respected. #2516

Closed
jsimnz opened this issue Apr 11, 2024 · 0 comments · Fixed by #2513
Closed

Implicit Collection transactions aren't respected. #2516

jsimnz opened this issue Apr 11, 2024 · 0 comments · Fixed by #2513
Labels
area/collections Related to the collections system bug Something isn't working
Milestone

Comments

@jsimnz
Copy link
Member

jsimnz commented Apr 11, 2024

Describe the problem
Some collection call paths don't respect the intended transaction scope. Haven't looked all every method yet, but in can be seen in the collection.updateWithDocID (private func), which is given a transaction in its arguments, but then makes a call to collection.Get (public func), which doesn't get a transaction. This only affects the implicit transaction that collections will create if they haven't explicity (ie: collection.WithTxn) been given one.

This is because the collection.getTxn will create a new transaction on every call unless there is an existing transaction on the collection struct.

To Reproduce
Any public Collection call which uses implicit transactions that then calls another public Collection function.

Expected behavior
All DB calls respect the implicit or explicit transaction for the entire lifecycle/scope of that call.

@jsimnz jsimnz added bug Something isn't working area/collections Related to the collections system labels Apr 11, 2024
@jsimnz jsimnz added this to the DefraDB v0.11 milestone Apr 11, 2024
@nasdf nasdf closed this as completed in ef228b8 Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collections Related to the collections system bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant