Opened 14 years ago
Last modified 14 years ago
#9979 new defect
[PATCH] Single changeset resync fails if changesets are missing
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | version control | Version: | 0.12-stable |
Severity: | normal | Keywords: | patch resync |
Cc: | Thijs Triemstra, peter.westwood@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When running repository resync repo rev
the operation fails if the revision you are trying to resync is missing from the revisions table. Attached patch "fixes" that, maybe not in the most elegant or correct way. Improvements welcome.
Attachments (1)
Change History (7)
by , 14 years ago
comment:1 by , 14 years ago
Cc: | added |
---|---|
Keywords: | patch added |
Summary: | Single changeset resync fails if changesets are missing → [PATCH] Single changeset resync fails if changesets are missing |
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Replying to cboos:
Or do you happen to have a situation where sync doesn't work?
Btw, thanks for providing a patch, that shows you're willing to help fix the problem! Note we never use
REPLACE INTO
as that's not portable (SQLite does it differently and PostgreSQL doesn't support that at all). What we usually do in this case is a UPDATE/SELECT/INSERT sequence, see source:tags/trac-0.12/trac/cache.py@:176-186#L169 for example.
Sync doesn't work either. I am working on http://plugins.trac.wordpress.org/ There are quite a few missing revisions from trac. (4645 - 13076). I am not sure how it happened, but resyncing the entire repo takes about 10 hours, so I am trying to avoid it. It also suffers from sqlite locking problems during the resync so I have to take down the entire site.
Trac [/home/trac/trac-environs/wp-plugins]> repository sync "(default)" 5001 5001 resynced on (default).
http://plugins.trac.wordpress.org/changeset/5001
Blank.
With my patch, I can run:
Trac [/home/trac/trac-environs/wp-plugins]> repository resync "(default)" 5000 5000 resynced on (default).
http://plugins.trac.wordpress.org/changeset/5000
As you can see the metadata is there now, but the node_change entries are missing. Related #9980
I just want to completely resync revisions 4645 - 13076 from SVN without resyncing the other 300+k revisions. Completely resyncing all of the data associated with a particular revision seems to be generally useful as well.
Regarding REPLACE - I kind of figured that after I uploaded the patch. If we decide this is useful I can redo the patch.
follow-up: 5 comment:4 by , 14 years ago
Keywords: | resync added |
---|---|
Milestone: | → next-major-0.1X |
Ok, thanks for the feedback. As you're using MySQL, chances are that you had this problem in the past due to #8067.
In the past, I once wrote a something similar (#1271), but failed to integrate it at that time. Vitaly updated it for 0.9, this might still be a good starting point, see attachment:trac-0.9stable-r2652.resync-ranges.patch:ticket:1271.
comment:5 by , 14 years ago
Replying to cboos:
Ok, thanks for the feedback. As you're using MySQL, chances are that you had this problem in the past due to #8067.
We are using sqlite, I am not sure yet when/how it broke. I haven't looked at the old databases yet to see if the problem is old or new.
In the past, I once wrote a something similar (#1271), but failed to integrate it at that time. Vitaly updated it for 0.9, this might still be a good starting point, see attachment:trac-0.9stable-r2652.resync-ranges.patch:ticket:1271.
Thanks for the link - I will check it out.
comment:6 by , 14 years ago
Cc: | added |
---|
If the revision is missing for whatever reason, a sync should normally be enough (not resync, but sync).
Or do you happen to have a situation where sync doesn't work?
Btw, thanks for providing a patch, that shows you're willing to help fix the problem! Note we never use
REPLACE INTO
as that's not portable (SQLite does it differently and PostgreSQL doesn't support that at all). What we usually do in this case is a UPDATE/SELECT/INSERT sequence, see source:tags/trac-0.12/trac/cache.py@:176-186#L169 for example.