Defect #1627

database not cleaned when removing a repository

Added by Thomas Capricelli 57 days ago. Updated 55 days ago.

Status:Closed Start:2008-07-12
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:SCM
Target version:0.8
Affected version:

Resolution:

Fixed


Description

If i add a (big) repository to a project, the db table 'changes' is filled with lot of stuff.

Too much in my case. I've removed the repository from the project by unselecting 'repository' in the module list from the configuration.

After this the database is still very large. I've looked in the table 'changes' and all changes related to this repository is still there.

Associated revisions

Revision 1666
Added by jplang 55 days ago

Clear changesets and changes with raw sql when deleting a repository (#1627).

History

2008-07-12 04:55 - Thomas Capricelli

if that matters, the scm used is mercurial (1.0.1) and the database is sqlite3 (3.5.6)

2008-07-12 05:27 - Thomas Capricelli

looking on internet, i managed to do it this way:

sqlite3 mydb.sqlite3
delete from changes where changes.changeset_id in (select changesets.id from changesets where changesets.repository_id=12);
delete from changesets where changesets.repository_id=12;

Though i dont know if this is the right way of doing it.
(and still, i would prefer redmien to handle this for me)

2008-07-13 22:36 - Jean-Philippe Lang

I'm not able to reproduce. changes and changesets tables should be cleaned up by the application.
Did you get a timeout when removing the repository from the application ?

2008-07-13 23:52 - Thomas Capricelli

timeout : i can't remember, but it could be. I'm trying to reproduce it and will report.

2008-07-13 23:57 - Jean-Philippe Lang

  • Status changed from New to Closed
  • Target version set to 0.8
  • Resolution set to Fixed

Removing a big repository could take a lot of time indeed.
Anyway, r1666 should fix it. Deletion is now done using 2 raw sql queries. Before that, one query was done for each changeset.

Thanks.

2008-07-14 03:53 - Thomas Capricelli

  • Target version deleted (0.8)

Hi Jean-Philippe. I updated to "Revision: 1666", did the rake thinguy and tested my website : everything works as expected.

I did the same manipulation as previously :
  1. add the huge repository (db size goes from 4mb to 63mb)
  2. remove the huge repository (db size unchanged)

To reduce the size, i had to manually edit the db ("sqlite3 production.db") and type "VACUUM;" which is the command for sqlite to clean up its data. I thought maybe you would want to issue this from redmine too. I understand this is highly dependant on the db and maybe this is difficult and/or not something you would want.

greatings.

2008-07-14 04:19 - Thomas Capricelli

  • Target version set to 0.8

(i didn't mean to remove the target version, i think redmine did it, maybe some unitialized stuff somewhere?)

Also available in: Atom PDF