Free Transactions with Rio Vista

Slides:



Advertisements
Similar presentations
Chapter 16: Recovery System
Advertisements

IDA / ADIT Lecture 10: Database recovery Jose M. Peña
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 CSIS 7102 Spring 2004 Lecture 8: Recovery (overview) Dr. King-Ip Lin.
Recovery CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
CSCI 3140 Module 8 – Database Recovery Theodore Chiasson Dalhousie University.
Jan. 2014Dr. Yangjun Chen ACS Database recovery techniques (Ch. 21, 3 rd ed. – Ch. 19, 4 th and 5 th ed. – Ch. 23, 6 th ed.)
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
G Robert Grimm New York University Recoverable Virtual Memory.
1 Minggu 8, Pertemuan 16 Transaction Management (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 23 Database Recovery Techniques.
Chapter 19 Database Recovery Techniques. Slide Chapter 19 Outline Databases Recovery 1. Purpose of Database Recovery 2. Types of Failure 3. Transaction.
G Robert Grimm New York University Recoverable Virtual Memory.
File System Variations and Software Caching May 19, 2000 Instructor: Gary Kimura.
July 16, 2015ICS 5411 Coping With System Failure Chapter 17 of GUW.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 1) Academic Year 2014 Spring.
Transactions and Reliability. File system components Disk management Naming Reliability  What are the reliability issues in file systems? Security.
Highly Available ACID Memory Vijayshankar Raman. Introduction §Why ACID memory? l non-database apps: want updates to critical data to be atomic and persistent.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
UNIX File and Directory Caching How UNIX Optimizes File System Performance and Presents Data to User Processes Using a Virtual File System.
HANDLING FAILURES. Warning This is a first draft I welcome your corrections.
Joonwon Lee Recovery. Lightweight Recoverable Virtual Memory Rio Vista.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
Reliability and Recovery CS Introduction to Operating Systems.
1 How can several users access and update the information at the same time? Real world results Model Database system Physical database Database management.
Using Model Checking to Find Serious File System Errors StanFord Computer Systems Laboratory and Microsft Research. Published in 2004 Presented by Chervet.
Chapter 4 Memory Management Virtual Memory.
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
Paging (continued) & Caching CS-3013 A-term Paging (continued) & Caching CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Storage Systems CSE 598d, Spring 2007 Rethink the Sync April 3, 2007 Mark Johnson.
Processes and Virtual Memory
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Database Recovery Zheng (Godric) Gu. Transaction Concept Storage Structure Failure Classification Log-Based Recovery Deferred Database Modification Immediate.
Free Transactions with Rio Vista Landon Cox April 15, 2016.
Speculative execution Landon Cox April 13, Making disk accesses tolerable Basic idea Remove disk accesses from critical path Transform disk latencies.
Day 28 File System.
File System Consistency
© 2013 Gribble, Lazowska, Levy, Zahorjan

Database recovery techniques
Database Recovery Techniques
DURABILITY OF TRANSACTIONS AND CRASH RECOVERY
Protecting Memory What is there to protect in memory?
CS422 Principles of Database Systems Failure Recovery
Free Transactions with Rio Vista
Recovery Control (Chapter 17)
Transactions and Reliability
Chapter 2: Computer-System Structures
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Database Management System
File Processing : Recovery
Swapping Segmented paging allows us to have non-contiguous allocations
Chapter 9: Virtual-Memory Management
Page Replacement.
Transactions Sylvia Huang CS 157B.
CSE 451: Operating Systems Autumn Module 16 Journaling File Systems
CSE 451: Operating Systems Spring 2011 Journaling File Systems
Printed on Monday, December 31, 2018 at 2:03 PM.
CSE 451: Operating Systems Spring Module 17 Journaling File Systems
Outline Introduction Background Distributed DBMS Architecture
Recovery System.
Speculative execution and storage
Lecture 20: Intro to Transactions & Logging II
Database Recovery 1 Purpose of Database Recovery
File System Implementation
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
CSE 451: Operating Systems Spring 2010 Module 14
Presentation transcript:

Free Transactions with Rio Vista Landon Cox April 2, 2018

Basic assumptions On-disk data is durable and has integrity But slow to access In-memory data is fast to access But not durable and may lack integrity What is the difference between durability and integrity? Durability: data survives faults (crashes and power loss) Integrity: data is correct in face of faults

Basic assumption Why does disk data have durability and integrity? Disk content survives power loss Disk data has integrity because of software interfaces Interface to disk is “explicit and complex” Requires interacting with disk drivers Unlikely to randomly duplicate driver functionality Driver calls are checked for errors Is the interface to memory explicit and complex? No, any store instruction modifies the state of memory Any store instruction can modify any writable memory address

Enter: battery-backed memory NVRAM: non-volatile RAM NVRAM is fast NVRAM makes memory durable NVRAM does not ensure data integrity Same simple interface as volatile RAM Random stores can corrupt in-memory data Question: how to ensure integrity of in-memory data? This becomes a protection question

Protection and NVRAM Previously in protection Language-level guarantees (Java) Instrumented code (Speculative execution) Virtual memory (Micro-kernels, etc.) Disadvantages of languages and instrumentation? Languages constrain programmer choice Languages do not support existing code in other languages Instrumentation can be slow Instrumentation requires interposing on all accesses

Rio file cache A file system interface in front of NVRAM Allows “warm reboot” Cache persists across reboots Inspect content, sync with disk No need to write synchronously No need to maintain dependencies May still want to maintain a journal Only flush when needed (no timers)

Rio file cache A file system interface in front of NVRAM Can apps corrupt cache? Unlikely to randomly generate write Can randomly store to mmap region Do we care about bad mmap stores? No, apps can corrupt their own data Take that risk when using mmap What about kernel stores? Failing kernel can still corrupt cache How to protect cache? Mark pages read-only unless accessed by FS Corruption must occur while cache is writable

Kinds of kernel failures Random bit flips in kernel address space To simulate, randomly flip memory bits Faulty instructions in kernel text To simulate, change src/dst registers of instructions Programming errors Delete initialization code Corrupt pointer variables Randomly free allocated data Overwrite data structures

Methodology Run benchmarks Randomly inject errors Wait for crash … Check to see if data has been corrupted

Protections remove the risk. Rio results Protections remove the risk. What we were afraid of.

Rio file cache How else can we use Rio? Transactions are great, but What about transactions? Transactions are great, but Rarely used outside of databases Synchronous writes are slow Can be hard to reason about aborts Rio can help make transactions fast 2,000 times faster!

Recoverable memory RVM: CMU library for recoverable memory Copy of updated memory region. Copy of initial memory region. In whose address space is the recoverable memory? In the application’s

Recoverable memory RVM: CMU library for recoverable memory How many times is data copied? 3: to undo log, to redo log, to database

Recoverable memory RVM: CMU library for recoverable memory What is the undo log used for? User-initiated aborts

Recoverable memory RVM: CMU library for recoverable memory What action commits the transaction? Write commit record to redo log

Recoverable memory RVM: CMU library for recoverable memory Which ACID properties does this provide? Durability and atomicity

Vista recoverable memory Vista: library for recoverable memory on Rio Why don’t we need the redo log? Can just use persistent undo log to recover

Vista recoverable memory Vista: library for recoverable memory on Rio Interface to Vista is a malloc-like heap manager

Vista recoverable memory Vista: library for recoverable memory on Rio What needs to be protected? Heap management, undo log

Vista recoverable memory Vista: library for recoverable memory on Rio Why aren’t Rio protections sufficient? Data lives in app address space Syscalls to alter protections  slow

Vista recoverable memory Vista: library for recoverable memory on Rio How is Vista protected? Create a moat around important data

Protecting Vista

Evaluation Why the drop off here? RVM and Vista both begin thrashing once the database is larger than available memory (roughly 200 MB). Note that RVM-Rio begins thrashing at half the database size of RVM and Vista due to double buffering. Double buffering results from frequent writes to the database file, effectively copying the database into the file cache. The result is two copies of the database: one in the process’s address space and another in the Rio file cache.

Evaluation Why the drop off here? RVM and Vista both begin thrashing once the database is larger than available memory (roughly 200 MB). Note that RVM-Rio begins thrashing at half the database size of RVM and Vista due to double buffering. Double buffering results from frequent writes to the database file, effectively copying the database into the file cache. The result is two copies of the database: one in the process’s address space and another in the Rio file cache.