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

Introduce log writer thread #1145

Closed
wants to merge 2 commits into from
Closed

Conversation

mihirj1993
Copy link

  • Introduce a log_writer thread which reads the txn_table and writes txn updates to the log.
  • The log_writer thread uses the log_writer APIs (Introduce log writer APIs (log_io.cpp, log_io.hpp) #1144) to process the txn log and generate pwrite() requests for the log file.
  • txn_commit() will signal to the log_writer thread to wake up and consume any new writes.
  • The log_writer is signaled twice: on the onset of validation to persist the txn updates and post validation to persist the txn decision.
  • The commit path will block till a txn's decision has been persisted to the log.
  • Once awoken, the log_writer thread will loop till a certain timeout (to let other txns get their writes in); this can be optimized to break out of the loop if two back to back iterations don't have any new changes.

This PR can use some refactoring (thread functionality can be moved from db_server to an alternate file. I have created a task for the same)

This codepath is currently switched off. Will be enabled when recovery is in place (PR coming up next)

@mihirj1993 mihirj1993 closed this Dec 16, 2021
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.

1 participant