Skip to content
New issue

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

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

Already on GitHub? # to your account

mnesia_to_khepri: Speed is_migration_finished() up #3

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

dumbbell
Copy link
Member

Why

The current approach queries Khepri to determine if a migration is in progress or even finished. This is quite expensive for what is expected a quick check to decide between the Mnesia and Khepri functions.

How

We use a Khepri projection and an ETS table to cache the migration statuses. This way, the check simply becomes an ETS lookup.

[Why]
The current approach queries Khepri to determine if a migration is in
progress or even finished. This is quite expensive for what is expected
a quick check to decide between the Mnesia and Khepri functions.

[How]
We use a Khepri projection and an ETS table to cache the migration
statuses. This way, the check simply becomes an ETS lookup.
@dumbbell dumbbell added the enhancement New feature or request label Oct 24, 2023
@dumbbell dumbbell added this to the v0.2.0 milestone Oct 24, 2023
@dumbbell dumbbell self-assigned this Oct 24, 2023
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (43c21d5) 74.95% compared to head (122a0b1) 74.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
- Coverage   74.95%   74.01%   -0.95%     
==========================================
  Files          13       13              
  Lines         599      608       +9     
==========================================
+ Hits          449      450       +1     
- Misses        150      158       +8     
Flag Coverage Δ
erlang-24 74.01% <80.95%> (-0.95%) ⬇️
erlang-25 74.01% <80.95%> (-0.95%) ⬇️
erlang-26 74.01% <80.95%> (-0.95%) ⬇️
os-ubuntu-latest 74.01% <80.95%> (-0.95%) ⬇️
os-windows-latest 74.01% <80.95%> (-0.95%) ⬇️

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

Files Coverage Δ
src/mnesia_to_khepri.erl 53.94% <100.00%> (-4.20%) ⬇️
src/m2k_table_copy.erl 74.56% <78.94%> (-1.96%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dumbbell dumbbell marked this pull request as ready for review October 24, 2023 10:22
@dumbbell dumbbell merged commit dbb3617 into main Oct 24, 2023
@dumbbell dumbbell deleted the speedup-is_migration_finished branch October 24, 2023 10:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant