Hex Artifact Content
Not logged in

Artifact 87d27f0d707889c1a1d8d681ef324bb836b9b99f:

File www/selfcheck.wiki part of check-in [7a2c37063a] - merge trunk into creole branch by bob on 2009-09-22 07:49:39. Also file www/selfcheck.wiki part of check-in [522824b26a] - Documentation updates, including a big rework of the homepage. by drh on 2009-08-28 16:05:03.

0000: 3c 74 69 74 6c 65 3e 46 6f 73 73 69 6c 20 52 65  <title>Fossil Re
0010: 70 6f 73 69 74 6f 72 79 20 49 6e 74 65 67 72 69  pository Integri
0020: 74 79 20 53 65 6c 66 2d 43 68 65 63 6b 73 3c 2f  ty Self-Checks</
0030: 74 69 74 6c 65 3e 0a 0a 3c 68 31 20 61 6c 69 67  title>..<h1 alig
0040: 6e 3d 22 63 65 6e 74 65 72 22 3e 46 6f 73 73 69  n="center">Fossi
0050: 6c 20 52 65 70 6f 73 69 74 6f 72 79 20 49 6e 74  l Repository Int
0060: 65 67 72 69 74 79 20 53 65 6c 66 2d 43 68 65 63  egrity Self-Chec
0070: 6b 73 3c 2f 68 31 3e 0a 0a 46 6f 73 73 69 6c 20  ks</h1>..Fossil 
0080: 69 73 20 64 65 73 69 67 6e 65 64 20 77 69 74 68  is designed with
0090: 20 66 65 61 74 75 72 65 73 20 74 6f 20 67 69 76   features to giv
00a0: 65 20 69 74 20 61 20 68 69 67 68 20 6c 65 76 65  e it a high leve
00b0: 6c 0a 6f 66 20 69 6e 74 65 67 72 69 74 79 20 73  l.of integrity s
00c0: 6f 20 74 68 61 74 20 75 73 65 72 73 20 63 61 6e  o that users can
00d0: 20 68 61 76 65 20 63 6f 6e 66 69 64 65 6e 63 65   have confidence
00e0: 20 74 68 61 74 20 63 6f 6e 74 65 6e 74 20 77 69   that content wi
00f0: 6c 6c 0a 6e 65 76 65 72 20 62 65 20 6d 61 6e 67  ll.never be mang
0100: 6c 65 64 20 6f 72 20 6c 6f 73 74 20 62 79 20 46  led or lost by F
0110: 6f 73 73 69 6c 2e 0a 54 68 69 73 20 6e 6f 74 65  ossil..This note
0120: 20 64 65 73 63 72 69 62 65 73 20 74 68 65 20 64   describes the d
0130: 65 66 65 6e 73 69 76 65 20 6d 65 61 73 75 72 65  efensive measure
0140: 73 20 74 68 61 74 0a 46 6f 73 73 69 6c 20 75 73  s that.Fossil us
0150: 65 73 20 74 6f 20 68 65 6c 70 20 70 72 65 76 65  es to help preve
0160: 6e 74 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6c  nt information l
0170: 6f 73 73 20 64 75 65 20 74 6f 20 62 75 67 73 2e  oss due to bugs.
0180: 0a 0a 46 6f 73 73 69 6c 20 68 61 73 20 62 65 65  ..Fossil has bee
0190: 6e 20 68 6f 73 74 69 6e 67 20 69 74 73 65 6c 66  n hosting itself
01a0: 20 61 6e 64 20 6d 61 6e 79 20 6f 74 68 65 72 20   and many other 
01b0: 70 72 6f 6a 65 63 74 73 20 66 6f 72 0a 79 65 61  projects for.yea
01c0: 72 73 20 6e 6f 77 2e 20 20 4d 61 6e 79 20 62 75  rs now.  Many bu
01d0: 67 73 20 68 61 76 65 20 62 65 65 6e 20 65 6e 63  gs have been enc
01e0: 6f 75 6e 74 65 72 65 64 2e 20 20 42 75 74 2c 20  ountered.  But, 
01f0: 74 68 61 6e 6b 73 20 69 6e 20 6c 61 72 67 65 0a  thanks in large.
0200: 70 61 72 74 20 74 6f 20 74 68 65 20 64 65 66 65  part to the defe
0210: 6e 73 69 76 65 20 6d 65 61 73 75 72 65 73 20 64  nsive measures d
0220: 65 73 63 72 69 62 65 64 20 68 65 72 65 2c 20 6e  escribed here, n
0230: 6f 20 64 61 74 61 20 68 61 73 20 62 65 65 6e 0a  o data has been.
0240: 6c 6f 73 74 2e 20 20 54 68 65 20 69 6e 74 65 67  lost.  The integ
0250: 72 69 74 79 20 63 68 65 63 6b 73 20 61 72 65 20  rity checks are 
0260: 64 6f 69 6e 67 20 74 68 65 69 72 20 6a 6f 62 20  doing their job 
0270: 77 65 6c 6c 2e 3c 2f 70 3e 0a 0a 3c 68 32 3e 41  well.</p>..<h2>A
0280: 74 6f 6d 69 63 20 43 68 65 63 6b 2d 69 6e 73 20  tomic Check-ins 
0290: 57 69 74 68 20 52 6f 6c 6c 62 61 63 6b 3c 2f 68  With Rollback</h
02a0: 32 3e 0a 0a 54 68 65 20 66 6f 73 73 69 6c 20 72  2>..The fossil r
02b0: 65 70 6f 73 69 74 6f 72 79 20 69 73 20 61 6e 0a  epository is an.
02c0: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f  <a href="http://
02d0: 77 77 77 2e 73 71 6c 69 74 65 2e 6f 72 67 2f 22  www.sqlite.org/"
02e0: 3e 53 51 4c 69 74 65 20 76 65 72 73 69 6f 6e 20  >SQLite version 
02f0: 33 3c 2f 61 3e 20 64 61 74 61 62 61 73 65 20 66  3</a> database f
0300: 69 6c 65 2e 20 20 0a 53 51 4c 69 74 65 20 69 73  ile.  .SQLite is
0310: 20 76 65 72 79 20 6d 61 74 75 72 65 20 61 6e 64   very mature and
0320: 20 73 74 61 62 6c 65 20 61 6e 64 20 68 61 73 20   stable and has 
0330: 62 65 65 6e 20 69 6e 20 77 69 64 65 2d 73 70 72  been in wide-spr
0340: 65 61 64 20 75 73 65 20 66 6f 72 20 6d 61 6e 79  ead use for many
0350: 0a 79 65 61 72 73 2c 20 73 6f 20 77 65 20 61 72  .years, so we ar
0360: 65 20 63 6f 6e 66 69 64 65 6e 74 20 69 74 20 77  e confident it w
0370: 69 6c 6c 20 6e 6f 74 20 63 61 75 73 65 20 72 65  ill not cause re
0380: 70 6f 73 69 74 6f 72 79 0a 63 6f 72 72 75 70 74  pository.corrupt
0390: 69 6f 6e 2e 20 20 53 51 4c 69 74 65 0a 64 61 74  ion.  SQLite.dat
03a0: 61 62 61 73 65 73 20 64 6f 20 6e 6f 74 20 63 6f  abases do not co
03b0: 72 72 75 70 74 20 65 76 65 6e 20 69 66 20 61 20  rrupt even if a 
03c0: 70 72 6f 67 72 61 6d 20 6f 72 20 73 79 73 74 65  program or syste
03d0: 6d 20 63 72 61 73 68 20 6f 72 20 70 6f 77 65 72  m crash or power
03e0: 0a 66 61 69 6c 75 72 65 20 6f 63 63 75 72 73 20  .failure occurs 
03f0: 69 6e 20 74 68 65 20 6d 69 64 64 6c 65 20 6f 66  in the middle of
0400: 20 74 68 65 20 75 70 64 61 74 65 2e 20 20 49 66   the update.  If
0410: 20 73 6f 6d 65 20 6b 69 6e 64 20 6f 66 20 63 72   some kind of cr
0420: 61 73 68 0a 64 6f 65 73 20 6f 63 63 75 72 20 69  ash.does occur i
0430: 6e 20 74 68 65 20 6d 69 64 64 6c 65 20 6f 66 20  n the middle of 
0440: 61 20 63 68 61 6e 67 65 2c 20 74 68 65 6e 20 61  a change, then a
0450: 6c 6c 20 74 68 65 20 63 68 61 6e 67 65 73 20 61  ll the changes a
0460: 72 65 20 72 6f 6c 6c 65 64 0a 62 61 63 6b 20 74  re rolled.back t
0470: 68 65 20 6e 65 78 74 20 74 69 6d 65 20 74 68 61  he next time tha
0480: 74 20 74 68 65 20 64 61 74 61 62 61 73 65 20 69  t the database i
0490: 73 20 61 63 63 65 73 73 65 64 2e 0a 0a 41 20 63  s accessed...A c
04a0: 68 65 63 6b 2d 69 6e 20 6f 70 65 72 61 74 69 6f  heck-in operatio
04b0: 6e 20 69 6e 20 66 6f 73 73 69 6c 20 6d 61 6b 65  n in fossil make
04c0: 73 20 6d 61 6e 79 20 63 68 61 6e 67 65 73 20 74  s many changes t
04d0: 6f 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79  o the repository
04e0: 0a 64 61 74 61 62 61 73 65 2e 20 20 42 75 74 20  .database.  But 
04f0: 61 6c 6c 20 74 68 65 73 65 20 63 68 61 6e 67 65  all these change
0500: 73 20 68 61 70 70 65 6e 20 77 69 74 68 69 6e 20  s happen within 
0510: 61 20 73 69 6e 67 6c 65 20 74 72 61 6e 73 61 63  a single transac
0520: 74 69 6f 6e 2e 0a 49 66 20 73 6f 6d 65 74 68 69  tion..If somethi
0530: 6e 67 20 67 6f 65 73 20 77 72 6f 6e 67 20 69 6e  ng goes wrong in
0540: 20 74 68 65 20 6d 69 64 64 6c 65 20 6f 66 20 74   the middle of t
0550: 68 65 20 63 6f 6d 6d 69 74 2c 20 74 68 65 6e 20  he commit, then 
0560: 74 68 65 20 74 72 61 6e 73 61 63 74 69 6f 6e 0a  the transaction.
0570: 69 73 20 72 6f 6c 6c 65 64 20 62 61 63 6b 20 61  is rolled back a
0580: 6e 64 20 74 68 65 20 64 61 74 61 62 61 73 65 20  nd the database 
0590: 69 73 20 75 6e 63 68 61 6e 67 65 64 2e 0a 0a 3c  is unchanged...<
05a0: 68 32 3e 56 65 72 69 66 69 63 61 74 69 6f 6e 20  h2>Verification 
05b0: 4f 66 20 44 65 6c 74 61 20 45 6e 63 6f 64 69 6e  Of Delta Encodin
05c0: 67 73 20 50 72 69 6f 72 20 54 6f 20 54 72 61 6e  gs Prior To Tran
05d0: 73 61 63 74 69 6f 6e 20 43 6f 6d 6d 69 74 3c 2f  saction Commit</
05e0: 68 32 3e 0a 0a 54 68 65 20 63 6f 6e 74 65 6e 74  h2>..The content
05f0: 20 66 69 6c 65 73 20 74 68 61 74 20 63 6f 6d 70   files that comp
0600: 72 69 73 65 20 74 68 65 20 67 6c 6f 62 61 6c 20  rise the global 
0610: 73 74 61 74 65 20 6f 66 20 61 20 66 6f 73 73 69  state of a fossi
0620: 6c 20 72 65 73 70 6f 73 69 74 6f 72 79 0a 61 72  l respository.ar
0630: 65 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 20  e stored in the 
0640: 72 65 70 6f 73 69 74 6f 72 79 20 61 73 20 61 20  repository as a 
0650: 74 72 65 65 2e 20 20 54 68 65 20 6c 65 61 76 65  tree.  The leave
0660: 73 20 6f 66 20 74 68 65 20 74 72 65 65 20 61 72  s of the tree ar
0670: 65 0a 73 74 6f 72 65 64 20 61 73 20 7a 6c 69 62  e.stored as zlib
0680: 2d 63 6f 6d 70 72 65 73 73 65 64 20 42 4c 4f 42  -compressed BLOB
0690: 73 2e 20 20 49 6e 74 65 72 69 6f 72 20 6e 6f 64  s.  Interior nod
06a0: 65 73 20 61 72 65 20 64 65 6c 74 61 73 20 66 72  es are deltas fr
06b0: 6f 6d 20 74 68 65 69 72 0a 64 65 63 65 6e 64 61  om their.decenda
06c0: 6e 74 73 2e 20 20 41 20 6c 6f 74 20 6f 66 20 65  nts.  A lot of e
06d0: 6e 63 6f 64 69 6e 67 20 69 73 20 67 6f 69 6e 67  ncoding is going
06e0: 20 6f 6e 2e 20 20 54 68 65 72 65 20 69 73 0a 7a   on.  There is.z
06f0: 6c 69 62 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 20  lib-compression 
0700: 77 68 69 63 68 20 69 73 20 72 65 6c 61 74 69 76  which is relativ
0710: 65 6c 79 20 77 65 6c 6c 2d 74 65 73 74 65 64 20  ely well-tested 
0720: 62 75 74 20 73 74 69 6c 6c 20 6d 69 67 68 74 0a  but still might.
0730: 63 61 75 73 65 20 63 6f 72 72 75 70 74 69 6f 6e  cause corruption
0740: 20 69 66 20 75 73 65 64 20 69 6d 70 72 6f 70 65   if used imprope
0750: 72 6c 79 2e 20 20 41 6e 64 20 74 68 65 72 65 20  rly.  And there 
0760: 69 73 20 74 68 65 20 72 65 6c 61 74 69 76 65 6c  is the relativel
0770: 79 0a 6e 65 77 20 64 65 6c 74 61 2d 65 6e 63 6f  y.new delta-enco
0780: 64 69 6e 67 20 6d 65 63 68 61 6e 69 73 6d 20 64  ding mechanism d
0790: 65 73 69 67 6e 65 64 20 65 78 70 72 65 73 73 6c  esigned expressl
07a0: 79 20 66 6f 72 20 66 6f 73 73 69 6c 2e 20 20 57  y for fossil.  W
07b0: 65 20 77 61 6e 74 0a 74 6f 20 6d 61 6b 65 20 73  e want.to make s
07c0: 75 72 65 20 74 68 61 74 20 62 75 67 73 20 69 6e  ure that bugs in
07d0: 20 74 68 65 73 65 20 65 6e 63 6f 64 69 6e 67 20   these encoding 
07e0: 6d 65 63 68 61 6e 69 73 6d 73 20 64 6f 20 6e 6f  mechanisms do no
07f0: 74 20 6c 65 61 64 20 74 6f 0a 6c 6f 73 73 20 6f  t lead to.loss o
0800: 66 20 64 61 74 61 2e 0a 0a 54 6f 20 69 6e 63 72  f data...To incr
0810: 65 61 73 65 20 6f 75 72 20 63 6f 6e 66 69 64 65  ease our confide
0820: 6e 63 65 20 74 68 61 74 20 65 76 65 72 79 74 68  nce that everyth
0830: 69 6e 67 20 69 6e 20 74 68 65 20 72 65 70 6f 73  ing in the repos
0840: 69 74 6f 72 79 20 69 73 0a 72 65 63 6f 76 65 72  itory is.recover
0850: 61 62 6c 65 2c 20 66 6f 73 73 69 6c 20 6d 61 6b  able, fossil mak
0860: 65 73 20 73 75 72 65 20 69 74 20 63 61 6e 20 65  es sure it can e
0870: 78 74 72 61 63 74 20 61 6e 20 65 78 61 63 74 20  xtract an exact 
0880: 72 65 70 6c 69 63 61 74 65 0a 6f 66 20 65 76 65  replicate.of eve
0890: 72 79 20 63 6f 6e 74 65 6e 74 20 66 69 6c 65 20  ry content file 
08a0: 74 68 61 74 20 69 74 20 63 68 61 6e 67 65 73 20  that it changes 
08b0: 6a 75 73 74 20 70 72 69 6f 72 20 74 6f 20 74 72  just prior to tr
08c0: 61 6e 73 61 63 74 69 6f 6e 0a 63 6f 6d 6d 69 74  ansaction.commit
08d0: 2e 20 20 53 6f 20 64 75 72 69 6e 67 20 74 68 65  .  So during the
08e0: 20 63 6f 75 72 73 65 20 6f 66 20 63 68 65 63 6b   course of check
08f0: 2d 69 6e 20 28 6f 72 20 6f 74 68 65 72 20 72 65  -in (or other re
0900: 70 6f 73 69 74 6f 72 79 0a 6f 70 65 72 61 74 69  pository.operati
0910: 6f 6e 29 20 6d 61 6e 79 20 64 69 66 66 65 72 65  on) many differe
0920: 6e 74 20 66 69 6c 65 73 0a 69 6e 20 74 68 65 20  nt files.in the 
0930: 72 65 70 6f 73 69 74 6f 72 79 20 6d 69 67 68 74  repository might
0940: 20 62 65 20 6d 6f 64 69 66 69 65 64 2e 20 20 53   be modified.  S
0950: 6f 6d 65 20 66 69 6c 65 73 20 61 72 65 20 73 69  ome files are si
0960: 6d 70 6c 79 0a 63 6f 6d 70 72 65 73 73 65 64 2e  mply.compressed.
0970: 20 20 4f 74 68 65 72 20 66 69 6c 65 73 20 61 72    Other files ar
0980: 65 20 64 65 6c 74 61 20 65 6e 63 6f 64 65 64 20  e delta encoded 
0990: 61 6e 64 20 74 68 65 6e 20 63 6f 6d 70 72 65 73  and then compres
09a0: 73 65 64 2e 0a 57 68 69 6c 65 20 61 6c 6c 20 74  sed..While all t
09b0: 68 69 73 20 69 73 20 67 6f 69 6e 67 20 6f 6e 2c  his is going on,
09c0: 20 66 6f 73 73 69 6c 20 6d 61 6b 65 73 20 61 20   fossil makes a 
09d0: 72 65 63 6f 72 64 20 6f 66 20 65 76 65 72 79 20  record of every 
09e0: 66 69 6c 65 0a 74 68 61 74 20 69 73 20 65 6e 63  file.that is enc
09f0: 6f 64 65 64 20 61 6e 64 20 74 68 65 20 53 48 41  oded and the SHA
0a00: 31 20 68 61 73 68 20 6f 66 20 74 68 65 20 6f 72  1 hash of the or
0a10: 69 67 69 6e 61 6c 20 63 6f 6e 74 65 6e 74 20 6f  iginal content o
0a20: 66 20 74 68 61 74 0a 66 69 6c 65 2e 20 20 54 68  f that.file.  Th
0a30: 65 6e 20 6a 75 73 74 20 62 65 66 6f 72 65 20 74  en just before t
0a40: 72 61 6e 73 61 63 74 69 6f 6e 20 63 6f 6d 6d 69  ransaction commi
0a50: 74 2c 20 66 6f 73 73 69 6c 20 72 65 2d 65 78 74  t, fossil re-ext
0a60: 72 61 63 74 73 0a 74 68 65 20 6f 72 69 67 69 6e  racts.the origin
0a70: 61 6c 20 63 6f 6e 74 65 6e 74 20 6f 66 20 61 6c  al content of al
0a80: 6c 20 66 69 6c 65 73 20 74 68 61 74 20 77 65 72  l files that wer
0a90: 65 20 77 72 69 74 74 65 6e 2c 20 63 6f 6d 70 75  e written, compu
0aa0: 74 65 73 0a 74 68 65 20 53 48 41 31 20 63 68 65  tes.the SHA1 che
0ab0: 63 6b 73 75 6d 20 61 67 61 69 6e 2c 20 61 6e 64  cksum again, and
0ac0: 20 76 65 72 69 66 69 65 73 20 74 68 61 74 20 74   verifies that t
0ad0: 68 65 20 63 68 65 63 6b 73 75 6d 73 20 6d 61 74  he checksums mat
0ae0: 63 68 2e 0a 49 66 20 61 6e 79 74 68 69 6e 67 20  ch..If anything 
0af0: 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 75  does not match u
0b00: 70 2c 20 61 6e 20 65 72 72 6f 72 0a 6d 65 73 73  p, an error.mess
0b10: 61 67 65 20 69 73 20 70 72 69 6e 74 65 64 20 61  age is printed a
0b20: 6e 64 20 74 68 65 20 74 72 61 6e 73 61 63 74 69  nd the transacti
0b30: 6f 6e 20 72 6f 6c 6c 73 20 62 61 63 6b 2e 0a 0a  on rolls back...
0b40: 53 6f 2c 20 69 6e 20 6f 74 68 65 72 20 77 6f 72  So, in other wor
0b50: 64 73 2c 20 66 6f 73 73 69 6c 20 61 6c 77 61 79  ds, fossil alway
0b60: 73 20 63 68 65 63 6b 73 20 74 6f 20 6d 61 6b 65  s checks to make
0b70: 20 73 75 72 65 20 69 74 20 63 61 6e 0a 72 65 2d   sure it can.re-
0b80: 65 78 74 72 61 63 74 20 61 20 66 69 6c 65 20 62  extract a file b
0b90: 65 66 6f 72 65 20 69 74 20 63 6f 6d 6d 69 74 73  efore it commits
0ba0: 20 61 20 63 68 61 6e 67 65 20 74 6f 20 74 68 61   a change to tha
0bb0: 74 20 66 69 6c 65 2e 0a 48 65 6e 63 65 20 62 75  t file..Hence bu
0bc0: 67 73 20 69 6e 20 66 6f 73 73 69 6c 20 61 72 65  gs in fossil are
0bd0: 20 75 6e 6c 69 6b 65 6c 79 20 74 6f 20 63 6f 72   unlikely to cor
0be0: 72 75 70 74 20 74 68 65 20 72 65 70 6f 73 69 74  rupt the reposit
0bf0: 6f 72 79 20 69 6e 0a 61 20 77 61 79 20 74 68 61  ory in.a way tha
0c00: 74 20 70 72 65 76 65 6e 74 73 20 75 73 20 66 72  t prevents us fr
0c10: 6f 6d 20 65 78 74 72 61 63 74 69 6e 67 20 68 69  om extracting hi
0c20: 73 74 6f 72 69 63 61 6c 20 76 65 72 73 69 6f 6e  storical version
0c30: 73 20 6f 66 20 0a 66 69 6c 65 73 2e 0a 0a 3c 68  s of .files...<h
0c40: 32 3e 43 68 65 63 6b 73 75 6d 20 4f 76 65 72 20  2>Checksum Over 
0c50: 41 6c 6c 20 46 69 6c 65 73 20 49 6e 20 41 20 43  All Files In A C
0c60: 68 65 63 6b 2d 69 6e 3c 2f 68 32 3e 0a 0a 4d 61  heck-in</h2>..Ma
0c70: 6e 69 66 65 73 74 20 61 72 74 69 66 61 63 74 73  nifest artifacts
0c80: 20 74 68 61 74 20 64 65 66 69 6e 65 20 61 20 63   that define a c
0c90: 68 65 63 6b 2d 69 6e 20 68 61 76 65 20 74 77 6f  heck-in have two
0ca0: 20 66 69 65 6c 64 73 20 28 74 68 65 0a 52 2d 63   fields (the.R-c
0cb0: 61 72 64 20 61 6e 64 20 5a 2d 63 61 72 64 29 20  ard and Z-card) 
0cc0: 74 68 61 74 20 72 65 63 6f 72 64 20 4d 44 35 20  that record MD5 
0cd0: 68 61 73 68 73 20 6f 66 20 74 68 65 20 6d 61 6e  hashs of the man
0ce0: 69 66 65 73 74 20 69 74 73 65 6c 66 0a 61 6e 64  ifest itself.and
0cf0: 20 6f 66 20 61 6c 6c 20 6f 74 68 65 72 20 66 69   of all other fi
0d00: 6c 65 73 20 69 6e 20 74 68 65 20 6d 61 6e 69 66  les in the manif
0d10: 65 73 74 2e 20 20 50 72 69 6f 72 20 74 6f 20 61  est.  Prior to a
0d20: 6e 79 20 63 68 65 63 6b 2d 69 6e 0a 63 6f 6d 6d  ny check-in.comm
0d30: 69 74 2c 20 74 68 65 73 65 20 63 68 65 63 6b 73  it, these checks
0d40: 75 6d 73 20 61 72 65 20 76 65 72 69 66 69 65 64  ums are verified
0d50: 20 74 6f 20 65 6e 73 75 72 65 20 74 68 61 74 20   to ensure that 
0d60: 74 68 65 20 63 68 65 63 6b 2d 69 6e 0a 63 68 65  the check-in.che
0d70: 63 6b 65 64 20 69 6e 20 61 67 72 65 65 73 20 65  cked in agrees e
0d80: 78 61 63 74 6c 79 20 77 69 74 68 20 77 68 61 74  xactly with what
0d90: 20 69 73 20 6f 6e 20 64 69 73 6b 2e 20 20 53 69   is on disk.  Si
0da0: 6d 69 6c 61 72 6c 79 2c 0a 74 68 65 20 72 65 70  milarly,.the rep
0db0: 6f 73 69 74 6f 72 79 20 63 68 65 63 6b 73 75 6d  ository checksum
0dc0: 20 69 73 20 76 65 72 69 66 69 65 64 20 61 66 74   is verified aft
0dd0: 65 72 20 61 20 63 68 65 63 6b 6f 75 74 20 74 6f  er a checkout to
0de0: 20 6d 61 6b 65 0a 73 75 72 65 20 74 68 61 74 20   make.sure that 
0df0: 74 68 65 20 65 6e 74 69 72 65 20 72 65 70 6f 73  the entire repos
0e00: 69 74 6f 72 79 20 77 61 73 20 63 68 65 63 6b 65  itory was checke
0e10: 64 20 6f 75 74 20 63 6f 72 72 65 63 74 6c 79 2e  d out correctly.
0e20: 0a 4e 6f 74 65 20 74 68 61 74 20 74 68 65 73 65  .Note that these
0e30: 20 61 64 64 65 64 20 63 68 65 63 6b 73 20 75 73   added checks us
0e40: 65 20 61 20 64 69 66 66 65 72 65 6e 74 20 68 61  e a different ha
0e50: 73 68 20 28 4d 44 35 20 69 6e 73 74 65 61 64 0a  sh (MD5 instead.
0e60: 6f 66 20 53 48 41 31 29 20 69 6e 20 6f 72 64 65  of SHA1) in orde
0e70: 72 20 74 6f 20 61 76 6f 69 64 20 63 6f 6d 6d 6f  r to avoid commo
0e80: 6e 2d 6d 6f 64 65 20 66 61 69 6c 75 72 65 73 20  n-mode failures 
0e90: 69 6e 20 74 68 65 20 68 61 73 68 0a 61 6c 67 6f  in the hash.algo
0ea0: 72 69 74 68 6d 20 69 6d 70 6c 65 6d 65 6e 74 61  rithm implementa
0eb0: 74 69 6f 6e 2e 0a 0a 0a 3c 68 32 3e 43 68 65 63  tion....<h2>Chec
0ec0: 6b 73 75 6d 73 20 4f 6e 20 43 6f 6e 74 72 6f 6c  ksums On Control
0ed0: 20 41 72 74 69 66 61 63 74 73 20 41 6e 64 20 44   Artifacts And D
0ee0: 65 6c 74 61 73 3c 2f 68 32 3e 0a 0a 45 76 65 72  eltas</h2>..Ever
0ef0: 79 20 5b 2e 2f 66 69 6c 65 66 6f 72 6d 61 74 2e  y [./fileformat.
0f00: 77 69 6b 69 20 7c 20 63 6f 6e 74 72 6f 6c 20 61  wiki | control a
0f10: 72 74 69 66 61 63 74 5d 20 69 6e 20 61 20 66 6f  rtifact] in a fo
0f20: 73 73 69 6c 20 72 65 70 6f 73 69 74 6f 72 79 0a  ssil repository.
0f30: 63 6f 6e 74 61 69 6e 73 20 61 20 22 5a 2d 63 61  contains a "Z-ca
0f40: 72 64 22 20 62 65 61 72 69 6e 67 20 61 6e 20 4d  rd" bearing an M
0f50: 44 35 20 63 68 65 63 6b 73 75 6d 20 6f 76 65 72  D5 checksum over
0f60: 20 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 65   the rest of the
0f70: 0a 61 72 74 69 66 61 63 74 2e 20 20 41 6e 79 20  .artifact.  Any 
0f80: 6d 69 73 6d 61 74 63 68 20 63 61 75 73 65 73 20  mismatch causes 
0f90: 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 72 74 69  the control arti
0fa0: 66 61 63 74 20 74 6f 20 62 65 20 69 67 6e 6f 72  fact to be ignor
0fb0: 65 64 2e 0a 0a 54 68 65 20 5b 2e 2f 64 65 6c 74  ed...The [./delt
0fc0: 61 5f 66 6f 72 6d 61 74 2e 77 69 6b 69 20 7c 20  a_format.wiki | 
0fd0: 66 69 6c 65 20 64 65 6c 74 61 20 66 6f 72 6d 61  file delta forma
0fe0: 74 5d 20 69 6e 63 6c 75 64 65 73 20 61 20 33 32  t] includes a 32
0ff0: 2d 62 69 74 0a 63 68 65 63 6b 73 75 6d 20 6f 66  -bit.checksum of
1000: 20 74 68 65 20 74 61 72 67 65 74 20 66 69 6c 65   the target file
1010: 2e 20 20 57 68 65 6e 65 76 65 72 20 61 20 66 69  .  Whenever a fi
1020: 6c 65 20 69 73 20 72 65 63 6f 6e 73 74 72 75 63  le is reconstruc
1030: 74 65 64 20 66 72 6f 6d 0a 61 20 64 65 6c 74 61  ted from.a delta
1040: 2c 20 74 68 61 74 20 63 68 65 63 6b 73 75 6d 20  , that checksum 
1050: 69 73 20 76 65 72 69 66 69 65 64 20 74 6f 20 6d  is verified to m
1060: 61 6b 65 20 73 75 72 65 20 74 68 65 20 72 65 63  ake sure the rec
1070: 6f 6e 73 74 72 75 63 74 69 6f 6e 0a 77 61 73 20  onstruction.was 
1080: 64 6f 6e 65 20 63 6f 72 72 65 63 74 6c 79 2e 0a  done correctly..
1090: 0a 3c 68 32 3e 52 65 6c 69 61 62 69 6c 69 74 79  .<h2>Reliability
10a0: 20 56 65 72 73 75 73 20 50 65 72 66 6f 72 6d 61   Versus Performa
10b0: 6e 63 65 3c 2f 68 32 3e 0a 0a 53 6f 6d 65 20 76  nce</h2>..Some v
10c0: 65 72 73 69 6f 6e 20 63 6f 6e 74 72 6f 6c 20 73  ersion control s
10d0: 79 73 74 65 6d 73 20 6d 61 6b 65 20 61 20 62 69  ystems make a bi
10e0: 67 20 64 65 61 6c 20 6f 75 74 20 6f 66 20 62 65  g deal out of be
10f0: 69 6e 67 20 22 68 69 67 68 20 70 65 72 66 6f 72  ing "high perfor
1100: 6d 61 6e 63 65 22 0a 6f 72 20 74 68 65 20 22 66  mance".or the "f
1110: 61 73 74 65 73 74 20 76 65 72 73 69 6f 6e 20 63  astest version c
1120: 6f 6e 74 72 6f 6c 20 73 79 73 74 65 6d 22 2e 20  ontrol system". 
1130: 20 46 6f 73 73 69 6c 20 6d 61 6b 65 73 20 6e 6f   Fossil makes no
1140: 20 73 75 63 68 20 63 6c 61 69 6d 73 20 61 6e 64   such claims and
1150: 20 68 61 73 0a 6e 6f 20 73 75 63 68 20 61 6d 62   has.no such amb
1160: 69 74 69 6f 6e 2e 20 20 49 6e 64 65 65 64 2c 20  ition.  Indeed, 
1170: 70 72 6f 66 69 6c 69 6e 67 20 69 6e 64 69 63 61  profiling indica
1180: 74 65 73 20 74 68 61 74 20 66 6f 73 73 69 6c 20  tes that fossil 
1190: 62 65 61 72 73 20 61 0a 73 75 62 73 74 61 6e 74  bears a.substant
11a0: 69 61 6c 20 70 65 72 66 6f 72 6d 61 6e 63 65 20  ial performance 
11b0: 63 6f 73 74 20 66 6f 72 0a 64 6f 69 6e 67 20 61  cost for.doing a
11c0: 6c 6c 20 6f 66 20 74 68 65 20 63 68 65 63 6b 73  ll of the checks
11d0: 75 6d 6d 69 6e 67 20 61 6e 64 20 76 65 72 69 66  umming and verif
11e0: 69 63 61 74 69 6f 6e 20 6f 75 74 6c 69 6e 65 64  ication outlined
11f0: 20 61 62 6f 76 65 2e 0a 46 6f 73 73 69 6c 20 74   above..Fossil t
1200: 61 6b 65 73 20 74 68 65 20 70 68 69 6c 6f 73 6f  akes the philoso
1210: 70 68 79 20 6f 66 20 74 68 65 0a 3c 61 20 68 72  phy of the.<a hr
1220: 65 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 69  ef="http://en.wi
1230: 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69  kipedia.org/wiki
1240: 2f 54 68 65 5f 54 6f 72 74 6f 69 73 65 5f 61 6e  /The_Tortoise_an
1250: 64 5f 74 68 65 5f 48 61 72 65 22 3e 74 6f 72 74  d_the_Hare">tort
1260: 6f 69 73 65 3c 2f 61 3e 3a 0a 72 65 6c 69 61 62  oise</a>:.reliab
1270: 69 6c 69 74 79 20 69 73 20 6d 6f 72 65 20 69 6d  ility is more im
1280: 70 6f 72 74 61 6e 74 20 74 68 61 6e 20 72 61 77  portant than raw
1290: 20 73 70 65 65 64 2e 20 20 54 68 65 20 64 65 76   speed.  The dev
12a0: 65 6c 6f 70 65 72 73 20 6f 66 0a 66 6f 73 73 69  elopers of.fossi
12b0: 6c 20 73 65 65 20 6e 6f 20 6d 65 72 69 74 20 69  l see no merit i
12c0: 6e 20 67 65 74 74 69 6e 67 20 74 68 65 20 77 72  n getting the wr
12d0: 6f 6e 67 20 61 6e 73 77 65 72 20 71 75 69 63 6b  ong answer quick
12e0: 6c 79 2e 0a 0a 46 6f 73 73 69 6c 20 6d 61 79 20  ly...Fossil may 
12f0: 6e 6f 74 20 62 65 20 74 68 65 20 66 61 73 74 65  not be the faste
1300: 73 74 20 76 65 72 73 69 6f 6e 69 6e 67 20 73 79  st versioning sy
1310: 73 74 65 6d 2c 20 62 75 74 20 69 74 20 69 73 20  stem, but it is 
1320: 22 66 61 73 74 20 65 6e 6f 75 67 68 22 2e 0a 46  "fast enough"..F
1330: 6f 73 73 69 6c 20 72 75 6e 73 20 71 75 69 63 6b  ossil runs quick
1340: 6c 79 20 65 6e 6f 75 67 68 20 74 6f 20 73 74 61  ly enough to sta
1350: 79 20 6f 75 74 20 6f 66 20 74 68 65 20 64 65 76  y out of the dev
1360: 65 6c 6f 70 65 72 73 20 77 61 79 2e 20 20 0a 4d  elopers way.  .M
1370: 6f 73 74 20 6f 70 65 72 61 74 69 6f 6e 73 20 63  ost operations c
1380: 6f 6d 70 6c 65 74 65 20 69 6e 20 75 6e 64 65 72  omplete in under
1390: 20 61 20 73 65 63 6f 6e 64 2e 0a                  a second..