https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-02-24T20:20:03ZRedmineRedmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=76102009-02-24T20:20:03ZIsaac Cruz Ballesteros
<ul></ul><p>A deadlock has nothing to with lock wait timeout, a deadlock occurs when transaction A blocks transaction B, and B blocks A</p>
<p>Enter a 'show innodb status', it should describe the cause of the last deadlock</p> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=76192009-02-25T00:55:38ZMinjie Zhu
<ul><li><strong>File</strong> <a href="/attachments/1574">innodb_status_full.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1574/innodb_status_full.txt">innodb_status_full.txt</a> added</li></ul><p>Isaac Cruz Ballesteros wrote:</p>
<blockquote>
<p>A deadlock has nothing to with lock wait timeout, a deadlock occurs when transaction A blocks transaction B, and B blocks A</p>
</blockquote>
<p>Yes, I changed the lock wait time and it didn't work.</p>
<blockquote>
<p>Enter a 'show innodb status', it should describe the cause of the last deadlock</p>
</blockquote>
<p>Here is the output of the command (a full output in attachment)</p>
<pre>
=====================================
090225 9:30:05 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 11 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 64, signal count 64
Mutex spin waits 0, rounds 870, OS waits 1
RW-shared spins 171, OS waits 13; RW-excl spins 66, OS waits 50
------------------------
LATEST DETECTED DEADLOCK
------------------------
090224 20:36:24
*** (1) TRANSACTION:
TRANSACTION 0 10412, ACTIVE 0 sec, process no 19408, OS thread id 3032349584 inserting
mysql tables in use 1, locked 1
LOCK WAIT 3 lock struct(s), heap size 320, undo log entries 1
MySQL thread id 5, query id 20932 localhost root update
INSERT INTO `changesets` (`commit_date`, `committed_on`, `comments`, `revision`, `scmid`, `user_id`, `repository_id`, `committer`) VALUES('2007-10-26 20:29:48', '2007-10-26 20:29:48', 'test.log', '601', NULL, NULL, 1, 'tanaka')
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 281 n bits 944 index `changesets_repos_rev` of table `redmine/changesets` trx id 0 10412 lock mode S waiting
Record lock, heap no 278 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
0: len 4; hex 80000001; asc ;; 1: len 3; hex 363031; asc 601;; 2: len 4; hex 80000259; asc Y;;
*** (2) TRANSACTION:
TRANSACTION 0 10411, ACTIVE 29 sec, process no 19408, OS thread id 3032550288 setting auto-inc lock
mysql tables in use 1, locked 1
4 lock struct(s), heap size 1024, undo log entries 2130
MySQL thread id 4, query id 20970 localhost root update
INSERT INTO `changesets` (`commit_date`, `committed_on`, `comments`, `revision`, `scmid`, `user_id`, `repository_id`, `committer`) VALUES('2007-10-30 13:50:20', '2007-10-30 13:50:20', 'add', '674', NULL, NULL, 1, 'suzuki')
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 281 n bits 944 index `changesets_repos_rev` of table `redmine/changesets` trx id 0 10411 lock_mode X locks rec but not gap
Record lock, heap no 278 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
0: len 4; hex 80000001; asc ;; 1: len 3; hex 363031; asc 601;; 2: len 4; hex 80000259; asc Y;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `redmine/changesets` trx id 0 10411 lock mode AUTO-INC waiting
*** WE ROLL BACK TRANSACTION (1)
------------
TRANSACTIONS
------------
Trx id counter 0 10455
Purge done for trx's n:o < 0 10400 undo n:o < 0 0
History list length 2
Total number of lock structs in row lock hash table 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, process no 19408, OS thread id 3032750992
MySQL thread id 6, query id 166588 localhost root
show innodb status
</pre> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=76282009-02-25T09:42:57ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>See the doc about <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/RedmineRepositories">repositories</a>:</p>
<blockquote>
<p><strong>Important</strong>: When you first browse the repository, Redmine retrieves the description of all of the existing commits and stores them in the database.<br />This is done only once per repository but can very long (or even time out) if your repository has hundreds of commits.</p>
<p>To avoid this, you can do it offline.<br />After having your repository declared in Redmine, run the following command:</p>
<p>ruby script/runner "Repository.fetch_changesets" -e production</p>
<p>All commits will be retrieved in the Redmine database.</p>
</blockquote> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=76702009-02-26T09:40:39ZMinjie Zhu
<ul></ul><p>I know this way and it worked well, but in many case users cannot know how long the process will take until they try it, because it depends on the size of repository and the machine power. So I think users always try it by browser at first, but sometimes it will return an internal error which users don't know what caused it. That is why I think this is a defect of Redmine.</p>
<p>If, for example, the first fetch process ends with a timeout error, Redmine will detect it and tell user to do it offline instead. I think this will be a more friendly interface for user. Thank you.</p> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=425752012-10-31T21:05:43ZDaniel Felix
<ul></ul><p>Well, this could be closed too, doesn't it?</p>
<p>It seems to be some system specific error. This seems to be caused by to much data to transfer and a to short time to do this. ;-)</p> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=425782012-11-01T00:16:40ZToshi MARUYAMA
<ul><li><strong>Category</strong> changed from <i>Database</i> to <i>SCM</i></li><li><strong>Priority</strong> changed from <i>High</i> to <i>Low</i></li></ul> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=425792012-11-01T00:32:13ZToshi MARUYAMA
<ul></ul><p>I think we cannot close this issue.<br />Redmine does not use lock in fetching revisions from SCMs.<br />To prevent long time fetching, in Git and Mercurial, you can <b>push</b> divided revisions to repository.</p>
<p>For example.<br /><pre>
$ hg push -r 0.6.0
$ hg push -r 0.7.0
$ hg push -r 0.8.0
.
.
.
</pre></p> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=425922012-11-01T06:28:51ZAbdul Halim Mat Ali
<ul></ul><p>Toshi MARUYAMA, this should be closed as it is not a bug.<br />I have a lot of repository, each with many revisions and over 200MB of data.</p>
<p>Hence, running<br /><pre>
ruby script/runner "Repository.fetch_changesets" -e production
</pre><br />is critical after setting up the repository.</p>
<p>Once the script is run, it can take almost 1 hour, the next time you click the repository this issue will not happen.</p> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=638162015-05-21T17:37:40Z@ go2null
<ul></ul><p>Related to <a class="issue tracker-1 status-1 priority-5 priority-high2" title="Defect: Timeout risks: need asynchronous operations (New)" href="https://www.redmine.org/issues/1931">#1931</a> <em>Timeout risks: need asynchronous operations</em></p>
<p>Should be closed same as <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: mysql timeout when first browsing a large git repository (Closed)" href="https://www.redmine.org/issues/7002">#7002</a> <em>mysql timeout when first browsing a large git repository</em>?</p> Redmine - Defect #2824: MySQL Deadlock Error when showing a big repositoryhttps://www.redmine.org/issues/2824?journal_id=643162015-06-20T10:26:29ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-1 priority-5 priority-high2" href="/issues/1931">Defect #1931</a>: Timeout risks: need asynchronous operations</i> added</li></ul>