On Apr 16, 2009, at 11:32 PM, Greg Stein wrote:
> Hey Hyrum,
>
> I saw a couple core dumps from my wc-ng test run and took a look at
> one. This was from one of the upgrade tests. The problem is pretty
> easy to explain... solution? Euh...
>
> We point DB at a v11 directory, and it records that in a wcroot_t
> structure. There is no SDB for v11, so that member is NULL.
>
> Later, we come along and say "no. make that directory v12." But we
> don't update the SDB or WC_ID members of the structure. When code
> later executes, it says "oh, v12!" and proceeds to use the SDB. BOOM.
>
> Normally, the SDB is created when the wcroot_t is created. And we read
> the format at that time. The reset_format is monkeying with our
> expectations.
>
> I think the right answer is to have wc_db *forget* the wcroot_t
> structure (just store NULL; the PDH can stick around). Then call
> wc_db__init() for the directory in question. Next time wc_db looks at
> the directory, it will detect the version as a v12 directory.
We already call wc_db__init(), but that's before we get around to
reading the old entries, or writing the new ones. In general, the
order of operations (including loggy) is this:
1) Read the old "this dir" entry
2) Use the old "this dir" entry to call svn_wc__entries_init() (which
calls wc_db__init())
3) Handle wcprop conversion
4) Set the new wc format
5) Read the old entries
6) Write the entries in the new format
7) Remove the old entries file
Most of that happens loggily, so I'm not really sure where the best
place to nuke the pdh->wcroot value would be, nor how that can be
accomplished. The current upgrade implementation is nothing but
transitional code for when we migrate to wc-ng, and will need to be
seriously re-evaluated for a more permanent solution. Among the
issues: the role of loggy and atomic upgrades.
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1770630
Received on 2009-04-17 18:30:05 CEST