Coder Social home page Coder Social logo

disk-utils's People

Contributors

darinm223 avatar simbo1905 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

simbo1905

disk-utils's Issues

Improve testing

Right now tests are in the same file as the modules tested but the tests itself are large so they should be separated into a separate directory.

Also right now the code is using panic::catch_unwind in order to reliably remove test files when the code panics but it causes a lot of code bloat in each test case. Should look into either creating own temporary file wrapper (overloading Drop to remove the file) or using an existing temporary file library like:

https://github.com/Stebalien/tempfile

Add crc implementation

Log records are supposed to use crc checksums in order to detect corruptions. The crc algorithm needs to be implemented and the record test cases need to be modified to test for corruptions on read.

Add tests for redo log

Add tests for the redo log similar to that of the undo log except that they test more exactly what changes are flushed to disk on recover. One way is by making a store implementation that uses flush() and flush_change() to log all changes made in memory and on disk so that they can be tested against.

Research file level locking

Right now there are only mutexes to allow a single UndoLog instance to be shared among multiple threads but there is nothing to prevent other processes from tampering with the log files. Look into file level locking to hopefully allow multiple processes to write to the same log without race conditions.

Undo log needs to find last tid in recovery mode

{
let mut iter = WalIterator::new(&mut file)?;
if let Ok(data) = read_serializable_backwards::<UndoLogEntry<Data>>(&mut iter) {
match data {
UndoLogEntry::Transaction(Transaction::Commit(id)) => tid = id,
UndoLogEntry::Transaction(Transaction::Abort(id)) => tid = id,
_ => recover = true,
}
}
}

Right now this code doesn't set the tid of the latest committed transaction when recovery mode is set.

_ => recover = true,

Needs to be modified so that the iterator reads backward until it finds a COMMIT or ABORT record and sets the latest tid to the tid of that record.

Implement nonquiescent checkpointing for undo log

Right now the undo log has no checkpointing feature, so nonquiescent checkpointing should be implemented since it allows for checkpointing without refusing new transactions.

List of changes needed:

  1. Create BeginCheckpoint and EndCheckpoint implementing Serializable and add it for UndoLogEntry.
  2. In the start() function of UndoLog, keep track of every new transaction started.
  3. Create a checkpoint function that adds BeginCheckpoint with the currently active transaction ids to the log and flushes to disk. Keep track of the current checkpoint and if there already is a current checkpoint, refuse to create a new one until the current one has finished.
  4. Add code to commit() and abort() so that it removes the committed or aborted transaction from the active transactions and then checks the current checkpoint if all transactions in the checkpoint have finished (not in the active transactions).
  5. If all transactions have finished, add EndCheckpoint to the log and flush the log to disk.
  6. TODO: Handle recovery

Allow for multiple transactions

Right now the undo log only allows for one transaction at a time. Update the api so that it allows for multiple transactions. What is necessary is:

  1. Update start() to return the tid of the transaction started.
  2. Update write() to take in the tid of the transaction to write to.
  3. Update commit() and abort() to take in the tid of the transaction to commit or abort.
  4. Rename tid to last_tid and also store a HashSet of currently active tids.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.