You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Max Bowsher <ma...@ukf.net> on 2006/08/15 14:35:28 UTC

Need to bump repos format number for 1.4.0

We need to bump the repos format number for 1.4.

This is because of the svndiff1 stuff. The svndiff1 change is signalled 
by an increase of the *fs* format number from 1 to 2.

However, fs format numbers were not introduced until Subversion 1.2, 
thus the possibility that 1.0 or 1.1 could naively act on a svndiff1 
repository.

I brought the issue up with DannyB on IRC, and he was pretty confident 
that operations would fail (somewhat) cleanly because of the specifics 
of the svndiff0 to svndiff1 change, but I feel queasy on relying on 
particulars of the change to guard against problems.

Therefore, I think we need to:
* have 1.4 libsvn_repos create new repositories at format 4, except if 
--no-svndiff1 is specified, in which case format 3 is used.

* have 1.4 libsvn_repos accept both format 3 and format 4 repositories.


All ok? Clearly this needs to go into 1.4.0.

Max.




Re: [PATCH] Need to bump repos format number for 1.4.0

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Mon, Aug 21, 2006 at 05:17:16PM +0100, Malcolm Rowe wrote:
> On Tue, Aug 15, 2006 at 03:35:28PM +0100, Max Bowsher wrote:
> How about something like the attached?  (Warning: untested).
> 
> [[[
> Conditionally bump the format number of newly-created repositories to 4,
> depending on whether the created filesystem format number is greater than 1.
> 
> ...
> 

Actually, this seems to work pretty well.  For most operations, this
produces:

    svnadmin: Expected format '3' of repository; found format '4'
instead of:
    svnadmin: Expected FS format '1'; found format '2'

Prior to this change, older clients that didn't check the filesystem
format number would sometimes work:

    $ svnadmin dump repo/ -r0:2 > /dev/null
    * Dumped revision 0.
    * Dumped revision 1.
    * Dumped revision 2.

And sometimes wouldn't:

    $ svnadmin dump repo/ -r0:3 > /dev/null
    * Dumped revision 0.
    * Dumped revision 1.
    * Dumped revision 2.
    svnadmin: Invalid diff stream: insn 1 cannot be decoded

And note that while that's demonstrating a failure to read, there's no
reason that a similar failure might not occur during a write (to a file://
repository, for example).

I know that Max would like to use a different mechanism from
poking-the-format-file to determine whether we can use repository format
3 or 4, but I though it might be useful to note that the basic idea
appears sound.

[I didn't actually use a 1.1-era svnadmin, but hacked fs/format back to
'1' to get the same effect.  I think this is valid.]

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] Need to bump repos format number for 1.4.0

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Aug 15, 2006 at 03:35:28PM +0100, Max Bowsher wrote:
> We need to bump the repos format number for 1.4.
> 
> This is because of the svndiff1 stuff. The svndiff1 change is signalled 
> by an increase of the *fs* format number from 1 to 2.
> 
> However, fs format numbers were not introduced until Subversion 1.2, 
> thus the possibility that 1.0 or 1.1 could naively act on a svndiff1 
> repository.
> 
> I brought the issue up with DannyB on IRC, and he was pretty confident 
> that operations would fail (somewhat) cleanly because of the specifics 
> of the svndiff0 to svndiff1 change, but I feel queasy on relying on 
> particulars of the change to guard against problems.
> 
> Therefore, I think we need to:
> * have 1.4 libsvn_repos create new repositories at format 4, except if 
> --no-svndiff1 is specified, in which case format 3 is used.
> 
> * have 1.4 libsvn_repos accept both format 3 and format 4 repositories.
> 
> 

How about something like the attached?  (Warning: untested).

[[[
Conditionally bump the format number of newly-created repositories to 4,
depending on whether the created filesystem format number is greater than 1.

This prevents problems that might occur if a client that does not check
filesystem format numbers (a pre-1.2 client, for example) attempts to use
a repository containing a filesystem with format number > 1.

* subversion/libsvn_repos/repos.c
  (svn_repos_create): Read the filesystem format file back after creation
    and create a format 4 repository if the filesystem format is greater
    than 1, or a format 3 repository otherwise.
  (check_repos_format): Accept both format 3 and format 4 repositories.

* subversion/libsvn_repos/repos.h
  (SVN_REPOS__FORMAT_NUMBER): Bump default repository format number to 4,
    and explain the difference between formats 3 and 4.
]]]

I'm not overly-happy with the re-reading back the filesystem format
number because it hard-codes knowledge of the 'format' file's existence
and name in the filesystem, but I can't see a less-intrusive way (short
of adding a call to ask the filesystem what format it is, which seems
over the top).

Regards,
Malcolm

Re: Need to bump repos format number for 1.4.0

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Aug 15, 2006 at 03:35:28PM +0100, Max Bowsher wrote:
> However, fs format numbers were not introduced until Subversion 1.2, 
> thus the possibility that 1.0 or 1.1 could naively act on a svndiff1 
> repository.
> 

The implication of that statement seems to be that there are no conditions
under which fs format numbers are actually useful - is that correct?

That would be rather annoying.

> I brought the issue up with DannyB on IRC, and he was pretty confident 
> that operations would fail (somewhat) cleanly because of the specifics 
> of the svndiff0 to svndiff1 change, but I feel queasy on relying on 
> particulars of the change to guard against problems.
> 

I'm fairly sure that any operations that attempt to read an svndiff1
stream as svndiff0 will fail immediately - the stream header is incorrect
("SVN\1" vs "SVN\0").

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Need to bump repos format number for 1.4.0

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Aug 15, 2006 at 03:35:28PM +0100, Max Bowsher wrote:
> We need to bump the repos format number for 1.4.
> 

Oh, see also: this thread:

http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=96229

which was about the last time we considered bumping the repos version number.


So the situation is:

* We have been using a repository version number of 3 for ever (well,
  since 1.0).

* We introduced a filesystem version number in 1.2, but it's only checked
  by 1.2 and later clients.

* We introduced an optional feature (svndiff1) in 1.4 that requires the
  filesystem version number to be bumped.

* But no clients < 1.2 will check the filesystem version number, so
  they'll merrily try to read or write to the filesystem (which will
  probably work until they hit an svndiff1 stream, at which point
  it won't).

* So we need to bump the repository version number to 4, not to account
  for a change in the repository format per se, but to ensure that any
  clients take account of the filesystem version number.  (We could
  choose to only bump it to 4 if the filesystem version ends up as >1,
  rather than tying to a specific feature flag.)


I think I agree that we need to do this, even if it _might_ be safe
in this particular case, but I'd like to understand what the impact
will be to our users.

The last time this was discussed, there was some concern that this would
impact mixed-client users of file:/// repositories, but I don't think
that's so much of a problem here (particularly because an explicit
dump/load cycle is necessary to enable svndiff1 repositories in the
first place).

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org