Defect #3449

Redmine Takes Too Long On Large Mercurial Repository

Added by Carlo Camerino over 8 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2009-06-05
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

100%

Category:SCM
Target version:1.1.0
Resolution:Fixed Affected version:

Description

Hi ,

I have been using redmine together with mercurial. I used hg convert to convert a subversion repository into a mercurial one and then I configured redmine to read it.

Everytime I click on the repository tab, it hangs for a very long time and then responds afterwards. I thought that this was just initial but it happens everytime I click the Repository tab.

issue-3449-only.patch Magnifier (560 Bytes) Toshi MARUYAMA, 2010-02-11 22:11


Related issues

Related to Redmine - Defect #3567: Sorting for changesets might go wrong on Mercurial repos Closed 2009-06-30
Related to Redmine - Defect #1435: slow display of 'repository' tab for huge repository (pag... Closed 2008-06-12
Related to Redmine - Defect #8857: Git: Too long in fetching repositories after upgrade from... Closed 2011-07-20

Associated revisions

Revision 4611
Added by Toshi MARUYAMA almost 7 years ago

Fixed: repository: mercurial: sort changesets by revision (#3449, #3567).

In DVCS, changesets are not in date order.
Because Mercurial backend inserts changesets from eariest, 'ORDER BY id'
means 'order by revision number'.

Contributed by Yuya Nishihara.

Revision 5644
Added by Toshi MARUYAMA over 6 years ago

scm: git: add comments of revision order in fetch_changesets().

Related issues.
#5357, #6013, #7146, #4773, #4547, #1406, #3449, #3567.

History

#1 Updated by Carlo Camerino over 8 years ago

cpu utilization of ruby and hg process is 100% most of the time

#2 Updated by Carlo Camerino over 8 years ago

is this related to issue #3421

#3 Updated by Anil Gulecha about 8 years ago

I see the same issue with a hg repository.

#4 Updated by Giuseppe Ciotta almost 8 years ago

Hi,
same happens here - Did you manage to find a workaround?
As a side note - I've imported the mercurial repository from svn as well.

#5 Updated by Toshi MARUYAMA almost 8 years ago

Please see #4455 - Mercurial overhaul.

#6 Updated by Toshi MARUYAMA almost 8 years ago

This patch is only for this issue.
I will describe this patch purpose at #4455 - Mercurial overhaul later.

#7 Updated by Toshi MARUYAMA about 7 years ago

  • % Done changed from 70 to 100

The reason of this issue is Mercurial tip is not latest revision as I described at http://www.redmine.org/issues/4455#note-23 .

This issue is resolved by hg-changeset-order.patch at http://www.redmine.org/issues/4455#note-144 .

I created test repository for this issue and pushed to http://bitbucket.org/marutosi/redmine-hg-performance-test-repo .

How to create test repository

$ hg --version
Mercurial Distributed SCM (version 1.6.3)

$ hg clone -U -r 1.0.0 \
   http://bitbucket.org/marutosi/redmine-hgsubversion-allbranches-clean \
   redmine-hg-performance-test-repo
requesting all changes
adding changesets
adding manifests
adding file changes
added 3170 changesets with 17488 changes to 3055 files

$ hg --cwd redmine-hg-performance-test-repo/ pull -r 0.9.6 \
   http://bitbucket.org/marutosi/redmine-hgsubversion-allbranches-clean
pulling from http://bitbucket.org/marutosi/redmine-hgsubversion-allbranches-clean
searching for changes
adding changesets
adding manifests
adding file changes
added 119 changesets with 185 changes to 199 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)

$ hg --cwd redmine-hg-performance-test-repo/ tip
changeset:   3288:2f0bae5c51dc
branch:      0.9-stable
tag:         tip
user:        edavis10@e93f8b46-1217-0410-a6f0-8f06a7374b81
date:        Thu Jul 08 03:54:53 2010 +0000
summary:     Merged r3836 from trunk.

$ hg --cwd redmine-hg-performance-test-repo/ heads --topo
changeset:   3288:2f0bae5c51dc
branch:      0.9-stable
tag:         tip
user:        edavis10@e93f8b46-1217-0410-a6f0-8f06a7374b81
date:        Thu Jul 08 03:54:53 2010 +0000
summary:     Merged r3836 from trunk.

changeset:   3169:251c954b3994
branch:      1.0-stable
user:        edavis10@e93f8b46-1217-0410-a6f0-8f06a7374b81
date:        Sun Jul 18 16:39:00 2010 +0000
summary:     Change version to the show this is the stable branch.

$ hg --cwd redmine-hg-performance-test-repo/ branches
0.9-stable                  3288:2f0bae5c51dc
1.0-stable                  3169:251c954b3994
default                     3161:b993c63dcedb (inactive)

Latest revision is "3169:251c954b3994" (SVN r3857 : Sun Jul 18 16:39:00 2010 +0000).
Mercurial tip is "3288:2f0bae5c51dc" (SVN r3838 : Thu Jul 08 03:54:53 2010 +0000).

Current redmine mercurial adapter fetches 119(=3288-3169) changesets every time.

Before patch applied

Processing RepositoriesController#show (for 127.0.0.1 at 2010-10-09 01:04:48) [GET]
  Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 11151ms (View: 137, DB: 409) | 200 OK [http://localhost/projects/hg-performance-test/repository]

Processing RepositoriesController#show (for 127.0.0.1 at 2010-10-09 01:05:21) [GET]
  Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 11088ms (View: 139, DB: 417) | 200 OK [http://localhost/projects/hg-performance-test/repository]

Processing RepositoriesController#show (for 127.0.0.1 at 2010-10-09 01:05:52) [GET]
  Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 11181ms (View: 136, DB: 408) | 200 OK [http://localhost/projects/hg-performance-test/repository]

After patch applied

Processing RepositoriesController#show (for 192.168.11.90 at 2010-10-09 00:19:09) [GET]
  Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 1487ms (View: 154, DB: 245) | 200 OK [http://192.168.11.90/projects/hg-performance-test/repository]

Processing RepositoriesController#show (for 192.168.11.90 at 2010-10-09 00:19:13) [GET]
  Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 1750ms (View: 153, DB: 246) | 200 OK [http://192.168.11.90/projects/hg-performance-test/repository]

Processing RepositoriesController#show (for 192.168.11.90 at 2010-10-09 00:19:16) [GET]
  Parameters: {"action"=>"show", "id"=>"hg-performance-test", "controller"=>"repositories"}
Rendering template within layouts/base
Rendering repositories/show
Completed in 1508ms (View: 151, DB: 244) | 200 OK [http://192.168.11.90/projects/hg-performance-test/repository]

#8 Updated by Toshi MARUYAMA almost 7 years ago

  • Assignee set to Toshi MARUYAMA
  • Priority changed from High to Normal
  • Target version set to 1.1.0

#9 Updated by Toshi MARUYAMA almost 7 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Fixed in svn trunk by r4611 and 1.1 by r4612.

Also available in: Atom PDF