wayback: a user-level versioning file system for linux

38
1 Wayback: A User-level Versioning File System For Linux Brian Cornell, Peter Dinda, and Fabián Bustamante Computer Science Department Northwestern University

Upload: others

Post on 12-Sep-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wayback: A User-level Versioning File System For Linux

1

Wayback: A User-level Versioning File System For Linux

Brian Cornell,Peter Dinda, and Fabián Bustamante

Computer Science DepartmentNorthwestern University

Page 2: Wayback: A User-level Versioning File System For Linux

2

Really excited last night● Great idea for this presentation● 3d rotating slides...● Woke up this morning, Oh no!● Too excited: no backup copy● No RCS1 or CVS2 check-in● Lucky, Wayback was there!● Reverted back to yesterday afternoon, and

here we are, aren't you glad?

1: F. Tichy, 1980.2: B. Berliner, 2001.

Page 3: Wayback: A User-level Versioning File System For Linux

3

Outline● Overview● Related work● How it works

– User's perspective● Behind the scenes

– System's perspective● Design decisions● Performance● Future work

Page 4: Wayback: A User-level Versioning File System For Linux

4

Wayback: Automatic Versioning● Automatic: Versions files and directories

without user interaction● Universal: Versions files of all types● Comprehensive: Never loses data● Generic: Works over any directory on any

base FS● User-space: Implemented in user-space

Free (GPL): http://wayback.sourceforge.net

Page 5: Wayback: A User-level Versioning File System For Linux

5

Related Work● VMS operating system [K McCoy, 1990]

– Version on close● Elephant [D Santry, et al, 1999]

– Exploit massive disks● VersionFS stackable file system [Muniswamy-

Reddy, et al, 2004]– Contemporaneous to this project– Implements different features

● Cedar [D. K. Gifford, et al, 1998], 3DFS [D. G. Korn, et al, 1989], CVFS [C. A. Soules, et al, 2003]

Page 6: Wayback: A User-level Versioning File System For Linux

6

How does it work?● Three simple steps

● Remount folder● Edit and work as normal● Revert or extract old versions

Page 7: Wayback: A User-level Versioning File System For Linux

7

Remount folder● Run wayback executable to remount

– wayback /mnt/data /home/brian/Projects● Use mount.wayback script to simplify and

mount for all users– mount.wayback /mnt/data /home/brian/Projects

● Files still at /mnt/data, but if you edit them at /home/brian/Projects, they are versioned

Page 8: Wayback: A User-level Versioning File System For Linux

8

Work normally● Edit files with any editor● Modify binary files too● Move, rename, delete files● Edit directories as much as you want● Everything you do is recorded and

remembered

Page 9: Wayback: A User-level Versioning File System For Linux

9

Revert or extract versions● List the versions of a file

– vstat Wayback.sxi● Revert a file to an old version

– To a time: vrevert -d 15:00:00 Wayback.sxi– To a date: vrevert -d 2004:06:29:15:00:00 Wayback.sxi– To a numbered version as listed by vstat:

vrevert -n 5 Wayback.sxi● Revert a directory to a date/time

– vrevert -d 2004:06:29:15:00:00 Documents● Note: Even reverting can be undone

Page 10: Wayback: A User-level Versioning File System For Linux

10

Revert or extract versions● Extract versions to a different file

– Same format as vrevert with a destination– vextract -d 2004:06:29:15:00:00 Wayback.sxi

GoodWayback.sxi● Delete the versioning if you're sure you don't

need it anymore– vrm Wayback.sxi– All versioning info for the file is permanently

deleted– File is not deleted. To delete file and versioning,

first delete file, then versioning.

Page 11: Wayback: A User-level Versioning File System For Linux

11

Behind the Scenes● FUSE1 module sends all FS calls to

Wayback● Everything kept track of transparently

● Hidden log files, one per file or directory● File operations recorded● Directory operations recorded

1: M. Szeredi,, Filesystem in USEr space, http://sourceforge.net/projects/avf

Page 12: Wayback: A User-level Versioning File System For Linux

12

Log Files● Every versioned file has a hidden log file

– Wayback.sxi. versionfs! version● Every directory has a hidden catalog

– Documents/. versionfs! version ● Logs created as soon as needed● Logs omitted from directory listing by

Wayback● Logs in binary custom format

Page 13: Wayback: A User-level Versioning File System For Linux

13

File Operations● On every write or

truncate, entry appended to log

● Data needed to undo write or truncate is written

Log file

PreviousLog

Entries...

TimestampWrite Offset

Overwritten SizeFile Enlarged Flag

OverwrittenData

Page 14: Wayback: A User-level Versioning File System For Linux

14

Directory Operations● When files are changed

in a way that changes their directory entries, directory catalog is updated

● Every operation writes timestamp and action ID

● Specific data per operation

Catalog file

PreviousCatalogEntries

...TimestampAction ID

ActionSpecific

Data

Page 15: Wayback: A User-level Versioning File System For Linux

15

Dir Ops: Create, Mkdir● Just needs to know name so it can be

deleted on revert

Length ofNameFile or

DirectoryName

Page 16: Wayback: A User-level Versioning File System For Linux

16

Dir Ops: Rm● First, file is truncated to 0 bytes

– File version log now has backup● Record file attributes

– Mode, owner, times● Record filename● Record destination for symbolic link

Size of Data

Filename[Link dest]

AttributesAttributes Contents:

Mode

Access Time

UID GID

Modified Time Create Time

Page 17: Wayback: A User-level Versioning File System For Linux

17

Dir Ops: Rmdir, Rename● Rmdir actually does rename and omits from

directory listing– Don't want to lose logs for files in directory

● Record old and new names

Length ofNames

Old and New

Names

Page 18: Wayback: A User-level Versioning File System For Linux

18

Dir Ops: Chmod, Chown, Utime● Just need to know the filename and the old

attributes

Size of Data

Filename

Attributes

Page 19: Wayback: A User-level Versioning File System For Linux

19

Design Decisions● User vs kernel level

– User: Remount any base FS– User: Development easier, more stable– Kernel: Faster

● Undo vs redo log– Undo: Everything always retained as long as

current version is not lost– Undo: No overhead of initial file copy– Redo: Files recoverable even if the current version

is lost

Page 20: Wayback: A User-level Versioning File System For Linux

20

Design Decisions● FUSE vs other user level modules

– It's modern and actively developed– It works with kernels 2.4 and 2.6– It gives complete but simple access to FS

operations– It's written in C (with which we are more familiar)

Page 21: Wayback: A User-level Versioning File System For Linux

21

Design Decisions● Comprehensive versioning vs others

– Record every operation that ever happens– Periodic: Choose time-granularity of versioning– Version on close: Assume one logical operation

per file open● Individual log per file vs central log

– Individual: No central point of failure– Individual: Simple, logs stay with files– Central: Doesn't consume inodes as fast

Page 22: Wayback: A User-level Versioning File System For Linux

22

What's the cost of Wayback?● 3 performance tests

– Bonnie1: Large file reads and writes– Andrew2: Typical use and compilation estimation– RCS: Versioning comparison with RCS

● Tested with ext3, FUSE, and Wayback

1: T. Bray, http://www.textuality.com/bonnie2: J. Howard, et al, 1988.

Page 23: Wayback: A User-level Versioning File System For Linux

23

Test machines● Tests on 3 machines

– Machine A: Normal● Athlon XP 2400● 512 Mb memory● 2.5 in notebook hard drive

– Machine B: Slow disk● Pentium IV 2.2 Ghz● 512 Mb memory● USB 1.1 hard drive

– Machine C: Slow processor● Celeron 500 Mhz● 128 Mb memory● 2.5 in notebook hard drive

Page 24: Wayback: A User-level Versioning File System For Linux

24

Bonnie: 30-70% max overhead

Write per character

Write per block

Rewrite Read per character

Read per block

0

2

4

6

8

10

12

14

16

18

ext3FUSEWayback

MB/

s

Page 25: Wayback: A User-level Versioning File System For Linux

25

Modified Andrew Benchmark● Andrew uses Makefile to run five phases

with Sun graphical source code● Modification uses Perl and Linux wm● Five phases:

– 1: Directory creation (mkdir)– 2: Copying files (cp)– 3: Stating files (ls -l)– 4: Reading files (grep and wc)– 5: Compilation (gcc)

Page 26: Wayback: A User-level Versioning File System For Linux

26

Andrew: Compile 15% slower

mkdir cp ls -l grep, wc gcc / 200

100

200

300

400

500

600

700

800

900

1000

1100

Ext3FUSEWaybackTi

me

(ms)

Page 27: Wayback: A User-level Versioning File System For Linux

27

RCS Comparison● 3 traces

– Binary write:● Random small changes with write system call

– Binary file:● Random small changes, but rewrite whole file

– Text:● Random changes to lines in text file

● 11 configurations– Wayback– RCS checkin after every k changes, k=1..10

Page 28: Wayback: A User-level Versioning File System For Linux

28

RCS: Wayback Faster

Wb 1 2 3 4 5 6 7 8 9 100

5

10

15

20

25

30

35

40

45

50

Binary writeBinary fileText x 10

Tim

e (s

)

Page 29: Wayback: A User-level Versioning File System For Linux

29

Future Work● Log compression

– Remove unnecessary granularity● Garbage collection

– Remove old versions● Limiting

– Limit number or size of versions● Customizable versioning

– Filter to only version some files, not others● Migration of virtual machines

– Undo/redo to sync virtual machines

Page 30: Wayback: A User-level Versioning File System For Linux

30

Summary● Don't lose important data!● RCS, CVS, etc require user action● Wayback automatically versions

– Remount directory with versioning– Edit files as normal– Writes are written as undo information– Easy to revert or extract to any time

● Wayback faster than RCS even excluding user time

Page 31: Wayback: A User-level Versioning File System For Linux

31

Get it!

It's free! (Gnu General Public License)

http://wayback.sourceforge.net

Page 32: Wayback: A User-level Versioning File System For Linux

32

RCS Size Comparison (MB)File Type Binary Write Binary File Text

Wayback 1157456.4 106347428.0 2182218.0RCS Period 1 2242325.4 3856521.8 101062.2RCS Period 2 2237020.7 3779180.4 96134.2RCS Period 3 2233854.1 3731427.8 94336.4RCS Period 4 2234384.4 3719578.2 93597.1RCS Period 5 2233716.4 3700853.4 93095.3RCS Period 6 2227924.3 3621657.1 92375.5RCS Period 7 2230300.3 3635107.2 92321.2RCS Period 8 2227552.2 3590195.5 91960.0RCS Period 9 2231124.4 3625548.8 92060.8RCS Period 10 2232218.7 3629717.4 92045.2

Page 33: Wayback: A User-level Versioning File System For Linux

33

Write per character

Write per block

Rewrite Read per character

Read per block

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1.1

Slow Disk: Bonnie Performance

ext3FUSEWayback

MB

/s

Page 34: Wayback: A User-level Versioning File System For Linux

34

Write per character

Write per block

Rewrite Read per character

Read per block

0

2

4

6

8

10

12

14

16

18

Slow Processor: Bonnie Performance

ext3FUSEWayback

MB

/s

Page 35: Wayback: A User-level Versioning File System For Linux

35

mkdir cp ls -l grep, wc gcc / 200

250

500

750

1000

1250

1500

1750

2000

2250

Slow Disk: Andrew Performance

Ext3FUSEWaybackTi

me

(ms)

Page 36: Wayback: A User-level Versioning File System For Linux

36

mkdir cp ls -l grep, wc gcc / 200

250

500

750

1000

1250

1500

1750

2000

2250

2500

2750

3000

Slow Processor: Andrew Performance

Ext3FUSEWaybackTi

me

(ms)

Page 37: Wayback: A User-level Versioning File System For Linux

37

Wb 1 2 3 4 5 6 7 8 9 100

5

10

15

20

25

30

35

40

45

50

55

60

Slow Disk: RCS Performance

Binary writeBinary fileText x 10

Tim

e (s

)

Page 38: Wayback: A User-level Versioning File System For Linux

38

Wb 1 2 3 4 5 6 7 8 9 100

10

20

30

40

50

60

70

80

90

100

110

Slow Processor: RCS Performance

Binary writeBinary fileText x 10

Tim

e (s

)