specifying and checking file system crash consistency
play

Specifying and Checking File System Crash-Consistency Models James - PowerPoint PPT Presentation

Specifying and Checking File System Crash-Consistency Models James Bornholt Antoine Kaufmann Jialin Li Arvind Krishnamurthy Emina Torlak Xi Wang University of Washington File systems persist our data Application File System File systems


  1. Specifying and Checking File System Crash-Consistency Models James Bornholt Antoine Kaufmann Jialin Li Arvind Krishnamurthy Emina Torlak Xi Wang University of Washington

  2. File systems persist our data Application File System

  3. File systems persist our data Application The best of times The worst of times File System

  4. File systems persist our data Application The best of times The best of times The worst of times The worst of times File System

  5. But what if the system crashes? Application The best of times The best of times The worst of times The worst of times File System

  6. But what if the system crashes? Application POSIX system calls The best of times The best of times The worst of times The worst of times File System

  7. But what if the system crashes? This provides roughly the same level of Application guarantees as ext3. Linux kernel ext4 documentation POSIX system calls The best of times The best of times If the file system is The worst of times The worst of times inconsistent a fu er a crash it is usually automatically checked and repaired when the File System system is rebooted Proposed POSIX fsync documentation

  8. But what if the system crashes? Application POSIX system calls The best of times The best of times The worst of times The worst of times File System

  9. But what if the system crashes? Application POSIX system calls The best of times The best of times The best o00000 The worst of times The worst of times 0000000 of tim Optimizations are exposed File System

  10. But what if the system crashes? Application When gradually appending to a file, the content gets corrupted, causing Chrome to crash POSIX system calls ChromeOS “FS corruption on panic”, 2015 The best of times The best of times The best o00000 The worst of times The worst of times 0000000 of tim …some of the KDE core Optimizations config files were reset. are exposed Also some of my MySQL databases were killed… Ubuntu “ext4 data loss”, 2009 File System

  11. Crash-consistency models Application Crash-consistency model File System

  12. Crash-consistency models Application A precise formal specification of the crash guarantees that a file system provides Crash-consistency model File System

  13. Crash-consistency models Just like a memory model! Application A precise formal specification of the crash guarantees that a file system provides Crash-consistency model File System

  14. Crash-consistency models Just like a memory model! Application A precise formal specification of the crash guarantees that a file system provides Crash-consistency model Ferrite File System Validate the model against the system with litmus tests

  15. Crash behavior of modern file systems Crash-consistency models Litmus tests & formal specifications Ferrite: developing crash-consistency models Building crash-safe applications

  16. Crash behavior of modern file systems Crash-consistency models Litmus tests & formal specifications Ferrite: developing crash-consistency models Building crash-safe applications

  17. Replacing the contents of a file foo.txt foo.txt foo.txt The best of times The age of wisdom The worst of times The epoch of belief

  18. Atomic replace via rename foo.txt foo.txt f = create(“foo.tmp”) The best of times The worst of times write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  19. Atomic replace via rename foo.txt foo.txt foo.tmp f = create(“foo.tmp”) The best of times The worst of times write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  20. Atomic replace via rename foo.txt foo.txt foo.tmp f = create(“foo.tmp”) The best of times The age of wisdom The worst of times write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  21. Atomic replace via rename foo.txt foo.txt foo.tmp f = create(“foo.tmp”) The best of times The age of wisdom The worst of times The epoch of belief write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  22. Atomic replace via rename foo.txt foo.txt foo.tmp f = create(“foo.tmp”) The best of times The age of wisdom The worst of times The epoch of belief write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  23. Atomic replace via rename foo.txt foo.tmp foo.txt f = create(“foo.tmp”) The best of times The age of wisdom The worst of times The epoch of belief write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  24. Atomic replace via rename f = create(“foo.tmp”) write(f, “The age of …”) write(f, “The epoch of …”) close(f) rename(“foo.tmp”, “foo.txt”)

  25. Atomic replace via rename create(“foo.tmp”) f = create(“foo.tmp”) write(f, “The age of …”) write(f, “The age of …”) write(f, “The epoch of …”) close(f) write(f, “The epoch of …”) rename(“foo.tmp”, “foo.txt”) rename(“foo.tmp”, “foo.txt”)

  26. Atomic replace via rename create(“foo.tmp”) write(f, “The age of …”) write(f, “The epoch of …”) rename(“foo.tmp”, “foo.txt”)

  27. Atomic replace via rename File operations Writes create(“foo.tmp”) write(f, “The age of …”) rename(“foo.tmp”, “foo.txt”) write(f, “The epoch of …”)

  28. Atomic replace via rename create(“foo.tmp”) rename(“foo.tmp”, “foo.txt”) write(f, “The age of …”) write(f, “The epoch of …”)

  29. Atomic replace via rename create(“foo.tmp”) foo.txt foo.txt foo.tmp The best of times The worst of times rename(“foo.tmp”, “foo.txt”) write(f, “The age of …”) write(f, “The epoch of …”)

  30. Atomic replace via rename create(“foo.tmp”) foo.txt foo.tmp foo.txt The best of times The worst of times rename(“foo.tmp”, “foo.txt”) write(f, “The age of …”) write(f, “The epoch of …”)

  31. Atomic replace via rename create(“foo.tmp”) foo.txt foo.tmp foo.txt The best of times The worst of times rename(“foo.tmp”, “foo.txt”) Crash! write(f, “The age of …”) write(f, “The epoch of …”)

  32. The storage stack write(f, “The age of …”) write(f, “The epoch of …”)

  33. The storage stack write(f, “The age of …”) write(f, “The epoch of …”) File System Block Layer Low-level Driver Controller

  34. The storage stack write(f, “The age of …”) write(f, “The epoch of …”) File System Block Layer Low-level Driver Controller Diagram by Werner Fischer

  35. The storage stack write(f, “The age of …”) write(f, “The epoch of …”) File System Block Layer Low-level Driver Controller

  36. The storage stack write(f, “The age of …”) write(f, “The epoch of …”) This provides roughly the same level of guarantees as ext3. File System Linux kernel ext4 documentation Block Layer Low-level Driver Controller

  37. The storage stack write(f, “The age of …”) write(f, “The epoch of …”) This provides roughly the same level of guarantees as ext3. File System Linux kernel ext4 documentation Block Layer The key aspects of fsync() are unreasonable to test in a test Low-level Driver suite POSIX specification for fsync Controller

  38. Existing work Formalize the existing POSIX write(f, “The age of …”) interface (e.g. SibylFS [SOSP’15]) write(f, “The epoch of …”) But the interface says nothing about crash safety File System Block Layer Low-level Driver Controller

  39. Existing work Formalize the existing POSIX write(f, “The age of …”) interface (e.g. SibylFS [SOSP’15]) write(f, “The epoch of …”) But the interface says nothing about crash safety File System Build a new crash-safe file system Block Layer (e.g. FSCQ [SOSP’15]) Comes with extremely high verification Low-level Driver burden Controller

  40. Existing work Formalize the existing POSIX write(f, “The age of …”) interface (e.g. SibylFS [SOSP’15]) write(f, “The epoch of …”) But the interface says nothing about crash safety File System Build a new crash-safe file system Block Layer (e.g. FSCQ [SOSP’15]) Comes with extremely high verification Low-level Driver burden Controller Find bugs in existing file systems (e.g. eXplode [OSDI’06]) Ours is a complementary problem: precisely specifying actual behavior

  41. Crash behavior of modern file systems Crash-consistency models Litmus tests & formal specifications Ferrite: developing crash-consistency models Building crash-safe applications

  42. Crash behavior of modern file systems Crash-consistency models Litmus tests & formal specifications Ferrite: developing crash-consistency models Building crash-safe applications

  43. Crash-consistency models

  44. Crash-consistency models Litmus tests Small programs that demonstrate allowed or forbidden behaviors of a file system across crashes

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend