We need to make versioning completely different. Problem:
- old versioning used UNIX timestamps (32bits), but had collisions due to seconds resolution (on the FS, they were avoided by using floats in early moin versions, but floats suck and xmlrpc only does ints).
- then we moved to usecs resolution, collision problem solved, but xmlrpc broke because it can't handle long ints. Oh well ... 8-(
- So for the 3rd try, we now just enumerate versions 1,2,3,4,... This makes xmlrpc happy again (and matches better how xmlrpc was designed, as it has separate fields for timestamp and version), but we now have to keep the timestamp somewhere else. The appropriate place is of course the edit-log.
So we change like this:
data/pages/PageName/backup/<UTC timestamp in usecs> becomes data/pages/PageName/revisions/<revno>
- mv 'current' 'notcurrent'
- if success ('current' was there):
- revno = read('notcurrent')
- revno++
- write('notcurrent', revno)
save to revisions/<revno>
- mv 'notcurrent' 'current'
- else give error msg and let user retry save
data/user/<uid>.bookmark stays in usecs
data/event-log stays in usecs
data/edit-log and data/pages/PageName/edit-log stay in usecs and:
old: PageName UserIp TimeUSecs UserHost UserId Comment Action
new: TimeUSecs PageName PageRev UserIp UserHost UserId Action Comment
Discussion
- Is current the lock file? How about calling it lock?
- Yes, it is. But it contains also the current page revision (if it is there). If it is not there, noone should write a new rev.
- Where is the advantage compared to moving a lockfile?
- is is a lockfile and a pointer to the top entry at once
- Where is the advantage compared to moving a lockfile?
- Yes, it is. But it contains also the current page revision (if it is there). If it is not there, noone should write a new rev.
Sample output
Especially the stuff with "None" at data[0] looks problematic, it means that we have a log entry, but no page file (or a bug somewhere).