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

feat: Add async transaction callbacks #2708

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

nasdf
Copy link
Member

@nasdf nasdf commented Jun 10, 2024

Relevant issue(s)

Resolves #2707

Description

This PR adds async versions for all transaction callbacks.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

make test

Specify the platform(s) on which this was tested:

  • MacOS

@nasdf nasdf added feature New feature or request area/datastore Related to the datastore / storage engine system labels Jun 10, 2024
@nasdf nasdf added this to the DefraDB v0.12 milestone Jun 10, 2024
@nasdf nasdf self-assigned this Jun 10, 2024
@nasdf nasdf requested a review from a team June 10, 2024 22:01
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 6 lines in your changes missing coverage. Please review.

Project coverage is 77.88%. Comparing base (05a0932) to head (5ccea09).

Current head 5ccea09 differs from pull request most recent head e70d101

Please upload reports for the commit e70d101 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2708   +/-   ##
========================================
  Coverage    77.87%   77.88%           
========================================
  Files          310      310           
  Lines        23125    23120    -5     
========================================
- Hits         18008    18005    -3     
- Misses        3728     3729    +1     
+ Partials      1389     1386    -3     
Flag Coverage Δ
all-tests 77.88% <88.89%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
datastore/concurrent_txn.go 50.00% <100.00%> (-11.90%) ⬇️
datastore/txn.go 100.00% <100.00%> (+3.51%) ⬆️
http/client_tx.go 31.82% <0.00%> (-5.02%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05a0932...e70d101. Read the comment docs.

for _, fn := range fns {
fn()
}
for _, fn := range asyncFns {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: The async functions need to be called before the non-async one otherwise they are less async than they could be..

for _, fn := range t.discardFns {
fn()
}
for _, fn := range t.discardAsyncFns {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: Same here. Asyncs need to be called first.

Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please resolve the two minor todos before merging :)

@nasdf nasdf merged commit d15b3b3 into sourcenetwork:develop Jun 10, 2024
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datastore Related to the datastore / storage engine system feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for async transaction callbacks
2 participants