GithubHelp home page GithubHelp logo

lightweight-recoverable-memory's Introduction

CS 6210: ADVANCED OPERATING SYSTEMS

PROJECT 4: Recoverable Virtual Memory

Team Members:

Anouksha Narayan ([email protected]) Nikita Mundada ([email protected])


Q. How you use log files to accomplish persistency plus transaction semantics? What goes in them? How do the files get cleaned up, so that they do not expand indefinitely?

A. We keep redo log files for each segment on the disk in order to ensure persistency of data structures. We also have an undo record in memory, that has the original data at the location being modified. In case a transaction commits, we write the new memory value along with its offset to the redo log corresponding to that particular segment. In case a transaction aborts, we re-write the original value from the undo record to the corresponding memory location (that the transaction was modifying). When a program calls map() without having called unmap() previously on an existing segment, the library returns an error. If the program wakes up from a crash, then there would be a segment file for it on disk but no record of it in memory. In this case, the program checks if there is a log file corresponding to that segment on the disk. If there is such a file, it applies changes in that log file to the segment on the disk making the segment up-to-date and the library then reads the current data in the segment to memory. It compares the current size of the segment on the disk to the size being passed by the program to map(). If the current size is smaller then, it expands the size of the segment on the disk to accommodate the extra demand for space. If the program is calling map() for the first time, then an in memory copy as well as a file on the disk is created for that segment.

There are two instances where the log files get cleaned up on the disk:

  1. In map(), before mapping the segment, if a redo log file exists for it then it first flushes the changes to the segment on the disk and then continues with the mapping. This prevents the log file from expanding indefinitely and also ensures that the segment has up-to-date data after recovering from a crash.

  2. The programmer can explicitly call truncate_log() to flush out all changes in each redo log file on the disk to its corresponding segment. It’s up to the programmer to periodically call truncate_log() to flush out all changes in one go.

lightweight-recoverable-memory's People

Contributors

nikmmy avatar

Watchers

 avatar

lightweight-recoverable-memory's Issues

make this repo private?

Hello,
We are re-using the assignment this semester. Can you please make your solution private.
thanks
TA

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.