Loading ...
Sorry, an error occurred while loading the content.

Re: Implementing CVS transactions via Phased Commit

Expand Messages
  • Michael Gersten
    Just my thoughts. ... If multiple people are running though this procedure at the same time, you can get some nasty conflicts at this stage (your files are
    Message 1 of 2 , May 3, 2000
    View Source
    • 0 Attachment
      Just my thoughts.

      Trying to get an automic multi-file commit:

      > (1) Edit files, and check them in.
      > [Errors may occur here, leaving some files checked
      > in and others not. No matter.]

      If multiple people are running though this procedure at the same time, you can
      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
      'CONSISTENT-b-date-uniqueid'

      > (2) Once all of the files are checked in, label them
      > CONSISTENT-date-uniqueid.
      > [Errors may occur here, leaving some files labelled,
      > and others not.]

      1b. By committing onto a branch, this is unlikely.

      > (3) Once all of the files are labelled CONSISTENT-date-uniqueid
      > edit a special file CONSISTENT, and add the CONSISTENT-date-uniqueid
      > label to it.

      1c. ok, but remember it's the branch tag.

      1d. Now that you have a consistent set of files, tagged, go and put them on the
      trunk.
      (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 contour
      > 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.

      Main benefit (that I see) of doing it on a branch first is that you are
      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.
    Your message has been successfully submitted and would be delivered to recipients shortly.