Skip to content

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.

2 participants