monotone Mtn Source Tree


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

Archive Download this file



Quick Links:    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status