monotone

monotone Mtn Source Tree

Root/UPGRADE

1upgrading monotone to 0.17
2==========================
3
4if you are upgrading from:
5 - 0.14 or earlier: see file README.changesets
6 - 0.15 or later: see below
7
8upgrading from 0.15 or 0.16
9---------------------------
10
11there was still some residual badness in the revision graph code in
120.16. we think we've caught it all now (we hope!), and there is now a
13great deal more coordinated effort put into stopping any such thing
14from sneaking in again, but... we have to do something about the
15badness that's already there.
16
17the solution is, another rebuild, like we did for the 0.15 -> 0.16
18transition. this is still obnoxious, still loses a little bit of
19history information (every revision remains exactly reconstructable,
20but rename information and information on who signed which certs are
21both lost), and still requires coordination among your whole team to
22pull of smoothly. we're sorry. we'll try not to do this again.
23
24just in case we _do_ have to do it again, though, and to help make
25this time smoother, we've added support for "epochs". there's a whole
26new section in the manual about all this, but basically, epochs are a
27way to let monotone keep track of who's done a rebuild, so you can't
28accidentally mix together pre-rebuild and post-rebuild databases.
29(epochs will also come in handy when it's time to migrate away from
30SHA1, for instance.) this means you have more of a safety net than
31last time, though you still have to coordinate within your team...
32
33so, the basic procedure is: one designated person gets to perform the
34rebuild, and deal with any missing files (see below). everyone else
35gets to 1) make sure the designated person has sync'ed with everyone,
36because anything that's not in the designated person's database will
37be lost, or at least, hard to deal with, 2) take a break, so the
38designated person can rebuild and test and such without having to deal
39with new commits.
40
41if you're the designated person, then you should:
42 1) make sure you have everyone's changes, and that they know they
43 shouldn't make any more changes until you give the all-clear
44 2) make a backup copy of your database. seriously, do this.
45 $ cp my.db my.db-backup
46 if something goes wrong, and you don't have a backup, there may
47 not be much we can do to help...
48 3) dump your database to SQL text using your old version of
49 monotone, and then reload it using your 0.17 version of
50 monotone. (this will migrate you from SQLite 2 to SQLite 3,
51 which have different on-disk formats.)
52 $ old-monotone --db=my.db db dump > my-db.dumped
53 $ monotone --db=new.db db load < my-db.dumped
54 (if you've been tracking the 0.17 development mainline, you can
55 skip this step. you still need to do all the others.)
56 4) do the usual 'db migrate' command, for migrating a database to a
57 later version:
58 $ monotone --db=new.db db migrate
59 (this will create the new tables needed for epoch support)
60 5) rebuild your ancestry. as mentioned above, this will lose
61 renames and cert signing information (all certs that you trust
62 will be re-issued with your signature; all other certs will be
63 lost), but will also generate new changesets that actually make
64 sense.
65 $ monotone --db=new.db db rebuild
66 6) check your database. this is the rough equivalent of running a
67 'fsck' or a 'scandisk' on your hard drive -- it just goes through
68 and makes sure that everything looks good. it's especially
69 important for detecting missing files; see below.
70 $ monotone --db=new.db db check 2>&1 | tee db-check.log
71 7) look at db-check.log, and if any files were missing, note down
72 their SHA1's, find the files, and load them into the database
73 with "fload".
74 $ monotone --db=new.db fload <missing-file
75 after doing this, run 'db check' again, until you get a clean
76 bill of health. (if you see problems other than missing files
77 and incomplete manifests/incomplete revisions, then there's
78 something more gone wrong, and you might want to ask the list at
79 monotone-devel@nongnu.org.)
80 8) put the new database somewhere where people can netsync to it.
81 (either by putting it there directly, or by creating a new
82 database on your server and pushing to it.)
83 9) tell everyone to create a new, empty database, and pull from your
84 server. (make sure they remember to copy their private keys over
85 from their old database, using 'monotone privkey' and 'monotone
86 read'.)
87
88missing files
89-------------
90
91unfortunately, monotone 0.16 had a bug that may have led to loss of
92data under certain, rare, circumstances. the bug is that, 0.16's
93"rebuild" (and probably "changesetify") commands incorrectly
94constructed root revisions. as a result, if you had any files that
95were in the initial import of your project, and then later deleted,
96without having had any changes made in between, then those files were
97invisible to netsync, and not transferred by "push", "pull", or
98"sync". therefore, if you rebuilt your database at the 0.16 release,
99and then pulled everything into a new database and deleted the
100original database, monotone has lost its record of those files's
101contents; if you attempted to check out a revision containing them you
102would get an assertion error.
103
104hopefully this should be a rare enough problem that most people don't
105run into it. the new 'db check' command detects this problem (indeed,
106it's how it was discovered in the first place), so it should be easy
107to find out whether you have it or not. if you _do_ have it, you need
108to find those missing files, and tell monotone about them. this is
109straightforward, though it may be tricky -- basically, 'db check' will
110tell you the SHA1's of the missing data. you need to find files that
111have those SHA1's, and load them into your master database. (that
112would be the database that you just ran 'db rebuild', as above.)
113
114some places to look:
115 -- old releases of your software
116 -- old copies of your monotone database (e.g., if you still have
117 pre-changesetify backups of it)
118 'cat file <SHA1>' is the useful command here
119 -- the database that you originally ran 'rebuild' or 'changesetify'
120 in, back at the 0.16 release. since the problem only affects
121 netsync, your initial database should be fine
122
123getting the manifest of your initial revision may also be helpful,
124since you can grep it to find the filenames of the missing files. you
125can do this by examining the output of 'cat revision <revision id>',
126and then running 'cat manifest <manifest id>'.
127
128once you've found the files, load them into your database with
129'fload', e.g.:
130 $ monotone --db=new.db fload <a-found-file
131
132if you cannot find the relevant files anywhere, then there's a more
133serious problem; your history is not fully reconstructible, and you
134won't be able to use it with 0.17, because the bug is now fixed. it
135should still be possible to reconstruct all revisions after the
136offending files were deleted, but this requires some code that doesn't
137currently exist; if you actually are in this state, please email
138<monotone-devel@nongnu.org> and we'll work something out.
139
140in the future, the more rigorous checking monotone now does should
141prevent problems like this from arising; in case you're nervous,
142though, you can always run 'db check' to check for problems.

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status