Re: Implementing CVS transactions via Phased Commit
- View SourceJust my thoughts.
Trying to get an automic multi-file commit:
> (1) Edit files, and check them in.If multiple people are running though this procedure at the same time, you can
> [Errors may occur here, leaving some files checked
> in and others not. No matter.]
get some nasty conflicts at this stage (your files are consistent in your
directory, but due to commit conflicts are not. You procede to edit and fix your
files, at the same time that somneone else is doing the same thing.)
I'd recomment this change:
1a. Edit files. Check them in on a branch. Use the tag
> (2) Once all of the files are checked in, label them1b. By committing onto a branch, this is unlikely.
> [Errors may occur here, leaving some files labelled,
> and others not.]
> (3) Once all of the files are labelled CONSISTENT-date-uniqueid1c. ok, but remember it's the branch tag.
> edit a special file CONSISTENT, and add the CONSISTENT-date-uniqueid
> label to it.
1d. Now that you have a consistent set of files, tagged, go and put them on the
(cvs update -A; cvs update -j CONSISTENT-b-date-uniqueid)
1e. Resolve any conflicts, until done.
Now procede with steps 2-3 above.
> (4) Have any tool that needs to get a consistent contourMain benefit (that I see) of doing it on a branch first is that you are
> read the CONSISTENT file and extract the label.
> Argument (pseudo-proof):
> Errors may occur in steps (1) and (2), leaving some files checked
> in and others not, or some labelled and others not. This doesn't matter.
> All we really need is atomicity on the checkin of the CONSISTENT file
> in step (3), which CVS and CC provide.
guaranteed to be able to commit your consistent set of changes, and track them.
It reduces the (unlikely, but possible) case of two (or more) developers working
on the same files at the same time.
> I'm not sure if it corresponds to 2 Phase Commit or 3 Phase Commit
> in the database sense. I think its 3PC, but CVS can have errors
> that leave the CVS repository unusable, e.g. globally locked, or
> a particular file locked, unless there is manual intervention.
> The CONSISTENT file may contain only a single label,
> or it might contain a timesorted sequence of labels.