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

Add checkpoint_active on the WAL #11

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

blakesmith
Copy link
Contributor

This new call immediately sends the active log file to the background checkpoint thread, regardless of its current size.

This is useful when you need to force written log entries to be immediately materialized in the database, perhaps during a node drain, or before a shutdown event.

Addresses: #10

Tests: Unit.

This new call immediately sends the active log file to the
background checkpoint thread, regardless of its current size.

This is useful when you need to force written log entries to be
immediately materialized in the database, perhaps during a node
drain, or before a shutdown event.

Addresses: khonsulabs#10

Tests: Unit.
Copy link
Member

@ecton ecton left a comment

Choose a reason for hiding this comment

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

This looks good at first glance, thank you for the contribution! It's been just long enough since I worked on this crate last that I want to check through it again before I do a release with the new feature.

@blakesmith
Copy link
Contributor Author

@ecton Sounds good. One thing that could be improved: This change holds the Files lock twice. Once to acquire the active file, and one to pass it to the background checkpoint thread. If you would rather that be combined, and carry the mutex guard across, I can make that change. If not, I'll keep it as is.

Let me know if you need anything else in the meantime!

@blakesmith
Copy link
Contributor Author

@ecton Any updates here?

@ecton ecton merged commit a3793c6 into khonsulabs:main Oct 11, 2023
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

Successfully merging this pull request may close these issues.

2 participants