Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Deadlock found when trying to get lock" in file locking #20555

Closed
LukasReschke opened this issue Nov 17, 2015 · 50 comments · Fixed by #24205
Closed

"Deadlock found when trying to get lock" in file locking #20555

LukasReschke opened this issue Nov 17, 2015 · 50 comments · Fixed by #24205

Comments

@LukasReschke
Copy link
Member

We have a ton of following entries, they appear dozens to hundreds of times per second:

{"reqId":"96M5ZtaObvQI\/q+FUTeB","remoteAddr":"93.202.76.110","app":"core","message":"Exception while scanning file \"msrex\/files_versions\/owncloud\/support\/XXXX\/XXXX/XXXX9\": An exception occurred while executing 'INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT ?,?,? FROM `oc_file_locks` WHERE `key` = ? HAVING COUNT(*) = 0' with params [\"files\\\/7a4d0ec119d9e99086554694bf6fa2bc\", 1, 1447758814, \"files\\\/7a4d0ec119d9e99086554694bf6fa2bc\"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","level":0,"time":"2015-11-17T10:13:34+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/ajax\/scan.php?force=false&dir=&requesttoken=TOKEN"}

@cmonteroluque @karlitschek @PVince81 FYI - this is what is killing S3 right now. I'd vote for priority on this once.
cc @icewind1991 THX!
cc @danimo

@LukasReschke LukasReschke added this to the 8.2.2-next-maintenance milestone Nov 17, 2015
@LukasReschke
Copy link
Member Author

I had to hack the apps/files/ajax/scan.php file to not do anything to provide at least some kind of server uptime. This should not hurt the server but is a big hack.

(somewhat related to #20545)

@nickvergessen
Copy link
Contributor

MariaDB [(none)]> SELECT @@GLOBAL.tx_isolation, @@tx_isolation
    -> ;
+-----------------------+-----------------+
| @@GLOBAL.tx_isolation | @@tx_isolation  |
+-----------------------+-----------------+
| REPEATABLE-READ       | REPEATABLE-READ |
+-----------------------+-----------------+
1 row in set (0.00 sec)

As per our docs we need READ_COMMITED
So running

SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

should fix the problem

@DeepDiver1975
Copy link
Member

As per our docs we need READ_COMMITED
So running

SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

should fix the problem

We are setting the transaction level in the ctor of the connection - what's going wrong here?

@DeepDiver1975
Copy link
Member

ctor of the connection

parent::setTransactionIsolation(parent::TRANSACTION_READ_COMMITTED);

@nickvergessen
Copy link
Contributor

We are setting the transaction level in the ctor of the connection - what's going wrong here?

maybe the account we use is not allowed to run this command?

@DeepDiver1975
Copy link
Member

maybe the account we use is not allowed to run this command?
@nickvergessen

we explicit set the transaction level on each connection we open

@icewind1991
Copy link
Contributor

Try running

<?php

require('lib/base.php');

$connection = \OC::$server->getDatabaseConnection();
$result = $connection->executeQuery('SELECT @@GLOBAL.tx_isolation, @@tx_isolation');
var_dump($result->fetchAll());

To check that the transaction level is set correctly

@LukasReschke
Copy link
Member Author

array(1) {
  [0]=>
  array(2) {
    ["@@GLOBAL.tx_isolation"]=>
    string(15) "REPEATABLE-READ"
    ["@@tx_isolation"]=>
    string(14) "READ-COMMITTED"
  }
}

This is 5.5.45-MariaDB from OpenSUSE.

@icewind1991
Copy link
Contributor

Can run SHOW ENGINE INNODB STATUS

That should get info about the most recent deadlock

@LukasReschke
Copy link
Member Author

Output below, note that we have restarted Apache and MySQL meanwhile. Let me know if we should add back the unmodified scan.php file to have newer results.

MariaDB [(none)]> show engine innodb status;
+--------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Type   | Name | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+--------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| InnoDB |      |
=====================================
151117  7:02:06 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 34 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 7516 1_second, 7515 sleeps, 751 10_second, 5 background, 5 flush
srv_master_thread log flush and writes: 6385
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 771387, signal count 774741
Mutex spin waits 739560370, rounds 3108379591, OS waits 154608
RW-shared spins 3612, rounds 75375, OS waits 2084
RW-excl spins 2150, rounds 140828, OS waits 4039
Spin rounds per wait: 4.20 mutex, 20.87 RW-shared, 65.50 RW-excl
--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
 ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 1; buffer pool: 0
110733 OS file reads, 321230 OS file writes, 169726 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 55.35 writes/s, 29.65 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 48, seg size 50, 481 merges
merged operations:
 insert 431, delete mark 112, delete 26
discarded operations:
 insert 0, delete mark 0, delete 0
Hash table size 4980499, node heap has 5332 buffer(s)
148.79 hash searches/s, 54.38 non-hash searches/s
---
LOG
---
Log sequence number 109757313341
Log flushed up to   109757312770
Last checkpoint at  109757186476
Max checkpoint age    7782360
Checkpoint age target 7539162
Modified age          126865
Checkpoint age        126865
1 pending log writes, 0 pending chkp writes
163979 log i/o's done, 28.85 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 2582937600; in additional pool allocated 0
Total memory allocated by read views 768
Internal hash tables (constant factor + variable factor)
    Adaptive hash index 127207696   (39843992 + 87363704)
    Page hash           2491144 (buffer pool 0 only)
    Dictionary cache    10240241    (9962608 + 277633)
    File system         99952   (82672 + 17280)
    Lock system         6228664     (6226408 + 2256)
    Recovery system     0   (0 + 0)
Dictionary memory allocated 277633
Buffer pool size        153599
Buffer pool size, bytes 2516566016
Free buffers            37285
Database pages          110982
Old database pages      40987
Modified db pages       188
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 34, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 110684, created 298, written 153637
0.00 reads/s, 0.00 creates/s, 25.91 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 110982, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
1 transactions active inside InnoDB
1 out of 1000 descriptors used
---OLDEST VIEW---
Normal read view
Read view low limit trx n:o 3EF789F3
Read view up limit trx id 3EF789F3
Read view low limit trx id 3EF789F3
Read view individually stored trx ids:
-----------------
Main thread process no. 13379, id 140179238106880, state: sleeping
Number of rows inserted 1098, updated 220486, deleted 570, read 4528585261
0.00 inserts/s, 36.20 updates/s, 0.00 deletes/s, 649295.23 reads/s
------------
TRANSACTIONS
------------
Trx id counter 3EF78A77
Purge done for trx's n:o < 3EF789F3 undo n:o < 0
History list length 3188
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 12420, OS thread handle 0x7f7dfc085700, query id 3637048 localhost root
show engine innodb status
---TRANSACTION 3EF78A6B, not started
MySQL thread id 12424, OS thread handle 0x7f7eb451a700, query id 3637046 localhost oc_admin
---TRANSACTION 3EF78A73, not started
MySQL thread id 12422, OS thread handle 0x7f7eb40cb700, query id 3637049 localhost oc_admin
---TRANSACTION 3EF78A69, not started flushing log
mysql tables in use 1, locked 1
MySQL thread id 12421, OS thread handle 0x7f7e0653a700, query id 3636901 localhost oc_admin query end
UPDATE `oc_file_locks` SET `lock` = `lock` + 1, `ttl` = '1447765326' WHERE `key` = 'files/f8eceed7adb972f4f893929a878f18c4' AND `lock` >= 0
---TRANSACTION 3EF78A5B, not started flushing log
mysql tables in use 1, locked 1
MySQL thread id 12411, OS thread handle 0x7f7dfc1f2700, query id 3636800 localhost oc_admin query end
UPDATE `oc_file_locks` SET `lock` = `lock` - 1 WHERE `key` = 'files/44a097cbb917abc6ca70bcf212569439' AND `lock` > 0
---TRANSACTION 3EF78A76, ACTIVE 0 sec
mysql tables in use 1, locked 0
MySQL thread id 12423, OS thread handle 0x7f7eb4114700, query id 3637047 localhost oc_admin Sorting result
SELECT `oc_share`.`id`, `item_type`, `item_source`, `item_target`,`oc_share`.`parent`, `share_type`, `share_with`, `uid_owner`,`file_source`, `path`, `file_target`, `oc_share`.`permissions`,`stime`, `expiration`, `token`, `storage`, `mail_send`,`oc_storages`.`id` AS `storage_id`, `oc_filecache`.`parent` as `file_parent` FROM `oc_share` INNER JOIN `oc_filecache` ON `file_source` = `oc_filecache`.`fileid`  AND `file_target` IS NOT NULL INNER JOIN `oc_storages` ON `numeric_id` = `oc_filecache`.`storage`  AND ((`share_type` in ('0', '2') AND `share_with` = 'cschmitz')  OR (`share_type` = '1' AND `
----------------------------
END OF INNODB MONITOR OUTPUT
============================
 |
+--------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)

@icewind1991
Copy link
Contributor

Let me know if we should add back the scan.php file to have newer results.

Please do

@icewind1991
Copy link
Contributor

(is this 8.2.0 or soon-to-be-8.2.1?)

@PVince81
Copy link
Contributor

There's no time left for 8.2.1 now, so 8.2.2

@icewind1991
Copy link
Contributor

I mean what s3 is running

@LukasReschke
Copy link
Member Author

Please do

Done. Will update as soon as it reappears.

(is this 8.2.0 or soon-to-be-8.2.1?)

This is 8.2.0 with #19976.

@LukasReschke
Copy link
Member Author

Ok. It reappeared. I can easily trigger it by calling apps/files/ajax/scan.php with a force value of true and then waiting.

{"reqId":"8BfwmChYfj7RRcCO7SdX","remoteAddr":"31.10.133.143","app":"core","message":"Exception while scanning file \"matt\/files\/Backup\/ownCloud Versions\/Version 3\/l10n\/zh_CN\/calendar.po\": An exception occurred while executing 'INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT ?,?,? FROM `oc_file_locks` WHERE `key` = ? HAVING COUNT(*) = 0' with params [\"files\\\/81bee15c1f501a76b7b67afc5e7a40a2\", 1, 1447765870, \"files\\\/81bee15c1f501a76b7b67afc5e7a40a2\"]:\n\nSQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","level":0,"time":"2015-11-17T12:11:10+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/ajax\/scan.php?force=false&dir=&XXXX0"}
MariaDB [(none)]> show engine innodb status;
+--------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Type   | Name | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+--------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| InnoDB |      |
=====================================
151117  7:11:53 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 38 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 8286 1_second, 8285 sleeps, 828 10_second, 5 background, 5 flush
srv_master_thread log flush and writes: 6994
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 831343, signal count 834315
Mutex spin waits 802968597, rounds 3361791989, OS waits 171597
RW-shared spins 4012, rounds 84143, OS waits 2306
RW-excl spins 2427, rounds 153972, OS waits 4393
Spin rounds per wait: 4.19 mutex, 20.97 RW-shared, 63.44 RW-excl
--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
 ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 1; buffer pool: 0
113559 OS file reads, 361123 OS file writes, 187632 OS fsyncs
0.24 reads/s, 16384 avg bytes/read, 95.81 writes/s, 32.74 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 48, seg size 50, 934 merges
merged operations:
 insert 2189, delete mark 113, delete 26
discarded operations:
 insert 0, delete mark 0, delete 0
Hash table size 4980499, node heap has 5359 buffer(s)
638.27 hash searches/s, 1581.30 non-hash searches/s
---
LOG
---
Log sequence number 109781227910
Log flushed up to   109781226610
Last checkpoint at  109775512353
Max checkpoint age    7782360
Checkpoint age target 7539162
Modified age          5652249
Checkpoint age        5715557
1 pending log writes, 0 pending chkp writes
180576 log i/o's done, 28.79 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 2582937600; in additional pool allocated 0
Total memory allocated by read views 8808
Internal hash tables (constant factor + variable factor)
    Adaptive hash index 127650064   (39843992 + 87806072)
    Page hash           2491144 (buffer pool 0 only)
    Dictionary cache    10240241    (9962608 + 277633)
    File system         99952   (82672 + 17280)
    Lock system         9677400     (6226408 + 3450992)
    Recovery system     0   (0 + 0)
Dictionary memory allocated 277633
Buffer pool size        153599
Buffer pool size, bytes 2516566016
Free buffers            33472
Database pages          114581
Old database pages      42277
Modified db pages       3322
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 214, not young 0
0.50 youngs/s, 0.00 non-youngs/s
Pages read 113510, created 1071, written 176228
0.24 reads/s, 3.32 creates/s, 64.92 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 114581, unzip_LRU len: 0
I/O sum[0]:cur[63], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
27 transactions active inside InnoDB
27 out of 1000 descriptors used
---OLDEST VIEW---
Normal read view
Read view low limit trx n:o 3EF8F9B5
Read view up limit trx id 3EF8ECEE
Read view low limit trx id 3EF8F9B5
Read view individually stored trx ids:
Read view trx id 3EF8F9AC
Read view trx id 3EF8F913
Read view trx id 3EF8F8D9
Read view trx id 3EF8F842
Read view trx id 3EF8F7B1
Read view trx id 3EF8F781
Read view trx id 3EF8F6BB
Read view trx id 3EF8F675
Read view trx id 3EF8F4C2
Read view trx id 3EF8F46D
Read view trx id 3EF8F392
Read view trx id 3EF8F309
Read view trx id 3EF8F246
Read view trx id 3EF8F1F3
Read view trx id 3EF8F102
Read view trx id 3EF8F06E
Read view trx id 3EF8F00D
Read view trx id 3EF8F001
Read view trx id 3EF8EFE4
Read view trx id 3EF8EE6B
Read view trx id 3EF8EE3B
Read view trx id 3EF8EDD4
Read view trx id 3EF8EDB8
Read view trx id 3EF8EDB4
Read view trx id 3EF8ED08
Read view trx id 3EF8ECEE
-----------------
Main thread process no. 13379, id 140179238106880, state: sleeping
Number of rows inserted 37501, updated 244722, deleted 570, read 4912227697
164.15 inserts/s, 45.47 updates/s, 0.00 deletes/s, 836433.91 reads/s
------------------------
LATEST DETECTED DEADLOCK
------------------------
151117  7:11:10
*** (1) TRANSACTION:
TRANSACTION 3EF8CD8E, ACTIVE 0 sec inserting
mysql tables in use 2, locked 1
LOCK WAIT 3 lock struct(s), heap size 376, 1 row lock(s), undo log entries 1
MySQL thread id 13268, OS thread handle 0x7f7dfc117700, query id 4031821 localhost oc_admin executing
INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT 'files/81bee15c1f501a76b7b67afc5e7a40a2','1','1447765870' FROM `oc_file_locks` WHERE `key` = 'files/81bee15c1f501a76b7b67afc5e7a40a2' HAVING COUNT(*) = 0
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 1821 n bits 248 index `lock_key_index` of table `owncloud7`.`oc_file_locks` trx id 3EF8CD8E lock mode S waiting
*** (2) TRANSACTION:
TRANSACTION 3EF8CD8C, ACTIVE 0 sec setting auto-inc lock
mysql tables in use 2, locked 1
4 lock struct(s), heap size 1248, 1 row lock(s), undo log entries 12
MySQL thread id 13321, OS thread handle 0x7f7eb43ad700, query id 4031827 localhost oc_admin executing
INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT 'files/77b9fd07f0fa334638ab6bd2b266562e','1','1447765870' FROM `oc_file_locks` WHERE `key` = 'files/77b9fd07f0fa334638ab6bd2b266562e' HAVING COUNT(*) = 0
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 417 page no 1821 n bits 248 index `lock_key_index` of table `owncloud7`.`oc_file_locks` trx id 3EF8CD8C lock_mode X locks rec but not gap
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `owncloud7`.`oc_file_locks` trx id 3EF8CD8C lock mode AUTO-INC waiting
*** WE ROLL BACK TRANSACTION (1)
------------
TRANSACTIONS
------------
Trx id counter 3EF8FA18
Purge done for trx's n:o < 3EF8F9B5 undo n:o < 0
History list length 2697
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 13475, OS thread handle 0x7f7d8f927700, query id 4078902 localhost root
show engine innodb status
---TRANSACTION 3EF8FA15, not started
MySQL thread id 13478, OS thread handle 0x7f7d8fa02700, query id 4078899 localhost oc_admin
---TRANSACTION 3EF8FA0E, not started flushing log
mysql tables in use 1, locked 1
MySQL thread id 13465, OS thread handle 0x7f7d8f696700, query id 4078872 localhost oc_admin query end
UPDATE `oc_file_locks` SET `lock` = `lock` - 1 WHERE `key` = 'files/6e6c9a4e996a5d39dc62e573a5192d2a' AND `lock` > 0
---TRANSACTION 3EF8F0FB, not started
MySQL thread id 13441, OS thread handle 0x7f7d8ff24700, query id 4070568 localhost oc_admin
---TRANSACTION 3EF8FA17, not started flushing log
mysql tables in use 2, locked 1
MySQL thread id 13341, OS thread handle 0x7f7eb40cb700, query id 4078901 localhost oc_admin query end
INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT 'files/8430c966a3cc050cf4811cbd66cdd0de','1','1447765913' FROM `oc_file_locks` WHERE `key` = 'files/8430c966a3cc050cf4811cbd66cdd0de' HAVING COUNT(*) = 0
---TRANSACTION 3EF8FA10, not started flushing log
MySQL thread id 13321, OS thread handle 0x7f7eb43ad700, query id 4078881 localhost oc_admin
COMMIT
---TRANSACTION 3EF8CC74, not started
MySQL thread id 12858, OS thread handle 0x7f7eb44d1700, query id 4030264 localhost oc_admin
---TRANSACTION 3EF8F9FC, ACTIVE 0 sec fetching rows
mysql tables in use 1, locked 1
124 lock struct(s), heap size 14776, 0 row lock(s)
MySQL thread id 13476, OS thread handle 0x7f7d8fbb8700, query id 4078806 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762313'
---TRANSACTION 3EF8F9AC, ACTIVE 1 sec fetching rows
mysql tables in use 1, locked 1
658 lock struct(s), heap size 80312, 0 row lock(s)
MySQL thread id 13470, OS thread handle 0x7f7d8fedb700, query id 4078591 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762312'
---TRANSACTION 3EF8F913, ACTIVE 1 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13477, OS thread handle 0x7f7d8fb6f700, query id 4078247 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762312'
------- TRX HAS BEEN WAITING 0 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F913 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F8D9, ACTIVE 1 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13472, OS thread handle 0x7f7d8f771700, query id 4077984 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762312'
------- TRX HAS BEEN WAITING 0 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F8D9 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F842, ACTIVE 3 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13474, OS thread handle 0x7f7d8f895700, query id 4077328 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762310'
------- TRX HAS BEEN WAITING 1 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F842 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F7B1, ACTIVE 3 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13473, OS thread handle 0x7f7d8f84c700, query id 4076859 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762310'
------- TRX HAS BEEN WAITING 2 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F7B1 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F781, ACTIVE 3 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13469, OS thread handle 0x7f7d8fcdc700, query id 4076755 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762310'
------- TRX HAS BEEN WAITING 2 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F781 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F6BB, ACTIVE 3 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13471, OS thread handle 0x7f7e06583700, query id 4076216 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762310'
------- TRX HAS BEEN WAITING 2 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F6BB lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F675, ACTIVE 4 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13468, OS thread handle 0x7f7d8f9b9700, query id 4075985 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762309'
------- TRX HAS BEEN WAITING 3 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F675 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F4C2, ACTIVE 5 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13463, OS thread handle 0x7f7eb43f6700, query id 4074898 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762308'
------- TRX HAS BEEN WAITING 4 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F4C2 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F46D, ACTIVE 5 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13467, OS thread handle 0x7f7d8fa4b700, query id 4074646 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762308'
------- TRX HAS BEEN WAITING 4 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F46D lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F392, ACTIVE 5 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13466, OS thread handle 0x7f7d8f64d700, query id 4073781 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762308'
------- TRX HAS BEEN WAITING 5 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F392 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F309, ACTIVE 6 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13464, OS thread handle 0x7f7eb451a700, query id 4073118 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762307'
------- TRX HAS BEEN WAITING 5 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F309 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F246, ACTIVE 7 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13429, OS thread handle 0x7f7d8f803700, query id 4071896 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762306'
------- TRX HAS BEEN WAITING 6 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F246 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F1F3, ACTIVE 8 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13462, OS thread handle 0x7f7d8f970700, query id 4071575 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762305'
------- TRX HAS BEEN WAITING 7 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F1F3 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F102, ACTIVE 9 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13461, OS thread handle 0x7f7d8f728700, query id 4070622 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762304'
------- TRX HAS BEEN WAITING 9 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F102 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F06E, ACTIVE 10 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13458, OS thread handle 0x7f7d8f6df700, query id 4070161 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762303'
------- TRX HAS BEEN WAITING 9 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F06E lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F00D, ACTIVE 10 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13459, OS thread handle 0x7f7dfc160700, query id 4069920 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762303'
------- TRX HAS BEEN WAITING 10 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F00D lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8F001, ACTIVE 10 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13457, OS thread handle 0x7f7d8f8de700, query id 4069870 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762303'
------- TRX HAS BEEN WAITING 10 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8F001 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8EFE4, ACTIVE 11 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13460, OS thread handle 0x7f7d8ffff700, query id 4069795 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762302'
------- TRX HAS BEEN WAITING 10 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8EFE4 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8EE6B, ACTIVE 12 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13454, OS thread handle 0x7f7dfc1f2700, query id 4068451 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762301'
------- TRX HAS BEEN WAITING 11 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8EE6B lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8EE3B, ACTIVE 12 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13455, OS thread handle 0x7f7d8f7ba700, query id 4068277 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762301'
------- TRX HAS BEEN WAITING 11 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8EE3B lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8EDD4, ACTIVE 12 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1095 lock struct(s), heap size 129464, 1 row lock(s)
MySQL thread id 13452, OS thread handle 0x7f7e0653a700, query id 4067800 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762301'
------- TRX HAS BEEN WAITING 11 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 2846 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8EDD4 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8EDB8, ACTIVE 12 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1758 lock struct(s), heap size 211384, 2 row lock(s)
MySQL thread id 13453, OS thread handle 0x7f7d8fe49700, query id 4067701 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762301'
------- TRX HAS BEEN WAITING 11 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 4214 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8EDB8 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8EDB4, ACTIVE 12 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1757 lock struct(s), heap size 211384, 1 row lock(s)
MySQL thread id 13456, OS thread handle 0x7f7e064f1700, query id 4067691 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762301'
------- TRX HAS BEEN WAITING 11 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 4214 n bits 288 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8EDB4 lock_mode X locks rec but not gap waiting
------------------
---TRANSACTION 3EF8ED08, ACTIVE 13 sec
3 lock struct(s), heap size 376, 1 row lock(s), undo log entries 5
MySQL thread id 13268, OS thread handle 0x7f7dfc117700, query id 4066899 localhost oc_admin
---TRANSACTION 3EF8ECEE, ACTIVE 13 sec fetching rows
mysql tables in use 1, locked 1
LOCK WAIT 1757 lock struct(s), heap size 211384, 1 row lock(s)
MySQL thread id 13451, OS thread handle 0x7f7d8fd25700, query id 4066702 localhost oc_admin updating
DELETE FROM `oc_file_locks` WHERE `lock` = 0 AND `ttl` < '1447762300'
------- TRX HAS BEEN WAITING 12 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 417 page no 4214 n bits 224 index `PRIMARY` of table `owncloud7`.`oc_file_locks` trx id 3EF8ECEE lock_mode X locks rec but not gap waiting
------------------
----------------------------
END OF INNODB MONITOR OUTPUT
============================
 |
+--------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.05 sec)

@nickvergessen
Copy link
Contributor

As per MySQL docs:

A global change to transaction characteristics requires the SUPER privilege. Any session is free to change its session characteristics (even in the middle of a transaction), or the characteristics for its next transaction.

Same for MariaDB:

A change to the global default isolation level requires the SUPER privilege. Any session is free to change its session isolation level (even in the middle of a transaction), or the isolation level for its next transaction.

This is the same from mysql 5.7 down to 5.0, so not sure why our call which sets it for the session doesn't work:
https://github.com/owncloud/3rdparty/blob/69768901fe25ad2aa71b23bbe7dbee2f8a07c13f/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L916-L919

@icewind1991
Copy link
Contributor

array(1) { [0]=> array(2) { ["@@GLOBAL.tx_isolation"]=> string(15) "REPEATABLE-READ" ["@@tx_isolation"]=> string(14) "READ-COMMITTED" } }

It does set the transaction level correctly for the session

@icewind1991
Copy link
Contributor

Ok going from the innodb status and mysql docs it seems to be caused by the INSERT INTO ... SELECT ... statement we do for insertIfNotExists, since the db can not know in advance how many entries are going to be inserted it needs to keep a table wide lock to handle the AUTO_INCREMENT value.

Setting innodb_autoinc_lock_mode to 2 should solve this issue but can cause issue when using statement based replicated (auto incremented ids not being the same across replicas)

Another option would be to drop the auto incrementing column from the locks which isn't used atm and only added for "good database design" although removing that might come to bite us in the future.

Relevant docs

@icewind1991
Copy link
Contributor

@PVince81 @DeepDiver1975 opinions on how to tackle the auto-increment issue

Note that this issue might also show up in other places that use insertIfNotExists, the locking table is only the first one to have this reproducible because it's the one with the most inserts (8.2.1 will reduce that dramatically)

@pako81
Copy link
Contributor

pako81 commented Mar 8, 2016

Yes, this is happening for only one User who is not then able to access her Home Folder (mounted with Windows Network Drive and $user variable).
Single instance of MySQL, oC 8.2.2, redis for transactional file locking enabled.

Error is:

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Please have a look at entry 4230 in the log file at ~/github-issues/core/20555/

@MorrisJobke
Copy link
Contributor

Another duplicate: #23043 (comment)

00005004

@MorrisJobke
Copy link
Contributor

Another duplicate: #23043 (comment)

Galera cluster of MariaDB with Maxscale in front to have the writes only gone to the master and all reads distributed at the slaves.

@PVince81
Copy link
Contributor

Galera cluster of MariaDB with Maxscale in front to have the writes only gone to the master and all reads distributed at the slaves.

@MorrisJobke you mean this is the workaround ? Sounds similar to #20555 (comment)

So it looks like this is something that can be solved by modifying the database/cluster configuration ?
(like #20555 (comment))

Anything else that needs to be done on the code side ?

@MorrisJobke
Copy link
Contributor

@MorrisJobke you mean this is the workaround ? Sounds similar to #20555 (comment)

No this is the description of the environment, where this happens ;)

@PVince81
Copy link
Contributor

I think I managed to reproduce the oc_file_lock deadlock while trying to reproduce #14757 which is the oc_filecache deadlock... fun times.

Steps will follow.

@PVince81
Copy link
Contributor

Steps:

  1. Check out v9.0.1
  2. Create a folder "test"
  3. Upload about 70 files into "test"
  4. Close the web UI to avoid heartbeat/getstoragestats interference
  5. Edit https://github.com/owncloud/core/blob/v9.0.1/lib/private/files/cache/scanner.php#L138 and add sleep(5) AFTER acquireLock to make sure the scanner lock takes longer
  6. Open two cadaver sessions A and B
  7. In config.php, set "filesystem_check_changes" to 1 to enable update detection (as it would be the case on ext storages too)
  8. Directly in the data directory, "touch data/admin/files data/admin/test data/admin/test/*" to trigger update detection
  9. In cadaver A, do a "ls". This will take a while because the scanner will find the changes and be slowed down by the delay.
  10. Wait a few seconds to let the scanner enter "test2" at some point
  11. While A is running, in cadaver B do "mv test test2" to rename the folder that is being scanner.

Expected result: the move should fail with "LockedException"
Actual result: cadaver A finished and cadaver B times out

{"reqId":"sh7bFoqG\/7UjFPJaG\/nJ","remoteAddr":"127.0.0.1","app":"core","message":"Exception while scanning file \"files\/test\/P1100409.JPG\": An exception occurred while executing 'UPDATE `oc_file_locks` SET `lock` = `lock` + 1, `ttl` = ? WHERE `key` = ? AND `lock` >= 0' with params [1461333331, \"files\\\/09915c88bfd09feb443462ab2efdaed9\"]:\n\nSQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction","level":0,"time":"2016-04-22T12:56:22+00:00","method":"MOVE","url":"\/owncloud\/remote.php\/webdav\/test","user":"admin"}
{"reqId":"sh7bFoqG\/7UjFPJaG\/nJ","remoteAddr":"127.0.0.1","app":"core","message":"Exception while scanning file \"files\/test\/P1100396.JPG\": An exception occurred while executing 'UPDATE `oc_file_locks` SET `lock` = `lock` + 1, `ttl` = ? WHERE `key` = ? AND `lock` >= 0' with params [1461333382, \"files\\\/6da551d2ba5a525a54f35d8e886fd9ca\"]:\n\nSQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction","level":0,"time":"2016-04-22T12:57:13+00:00","method":"MOVE","url":"\/owncloud\/remote.php\/webdav\/test","user":"admin"}
{"reqId":"sh7bFoqG\/7UjFPJaG\/nJ","remoteAddr":"127.0.0.1","app":"core","message":"Exception while scanning file \"files\/test\/P1070118.JPG\": An exception occurred while executing 'UPDATE `oc_file_locks` SET `lock` = `lock` + 1, `ttl` = ? WHERE `key` = ? AND `lock` >= 0' with params [1461333433, \"files\\\/48703870e9059df383d80fa6b1ebd8bb\"]:\n\nSQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction","level":0,"time":"2016-04-22T12:58:04+00:00","method":"MOVE","url":"\/owncloud\/remote.php\/webdav\/test","user":"admin"}

Observed with mariadb mariadb-10.0.22-2.1.x86_64.

The strange thing is that even though cadaver A finished already, cadaver B is still very slow to time out. I'd expect the second call to be excluded by the scanner lock.

So far I had the exception only once. Depending on the timings, cadaver B might also return with "403 Forbidden" or 404.

@PVince81
Copy link
Contributor

In mysql client on the CLI:

MariaDB [(none)]> SELECT @@GLOBAL.tx_isolation, @@tx_isolation
    -> ;
+-----------------------+-----------------+
| @@GLOBAL.tx_isolation | @@tx_isolation  |
+-----------------------+-----------------+
| REPEATABLE-READ       | REPEATABLE-READ |
+-----------------------+-----------------+
1 row in set (0.00 sec)

My DB user was given all permissions with "GRANT ALL PERMISSIONS", so I'd expect ownCloud's connection to be able to set the transaction modes properly.

@icewind1991
Copy link
Contributor

@PVince81 can you try 6881034

@PVince81
Copy link
Contributor

PVince81 commented Apr 22, 2016

Turns out I wasn't able to reproduce the original issue without this commit. It only happened once.

But this variation of the steps where cadaver B (the move) runs first and implicitly scans followed by cadaver A produces the deadlock errors.

Here are the updated steps:

  1. Check out v9.0.1
  2. Create a folder "test"
  3. Upload about 70 files into "test"
  4. Close the web UI to avoid heartbeat/getstoragestats interference
  5. Edit https://github.com/owncloud/core/blob/v9.0.1/lib/private/files/cache/scanner.php#L138 and add sleep(1) AFTER acquireLock to make sure the scanner lock takes longer. I also added a logging statement that logs $file so I can observe the progress.
  6. Open two cadaver sessions A and B
  7. In config.php, set "filesystem_check_changes" to 1 to enable update detection (as it would be the case on ext storages too)
  8. Directly in the data directory, "touch data/admin/files data/admin/test* data/admin/test_/_" to trigger update detection
  9. In cadaver B, rename: "mv test test2"
  10. While cadaver B is running, wait about 4 seconds, then go to cadaver A and do a "ls test"
  11. Observe owncloud.log

For every file that is to be scanned I see the deadlock message appearing.
And this is consistent!

Even weirder is that at the end, cadaver A still fails with "423 locked" and in the end the folder did not get renamed.

Next step: @icewind1991's commit

@PVince81
Copy link
Contributor

@icewind1991 I tested with your commit with both steps and could not make the deadlock issue appear again:

  1. ls before mv ("Deadlock found when trying to get lock" in file locking #20555 (comment))
  • Before the fix: both operations stayed stuck, then one of them might time out. Sometime deadlock.
  • After the fix: the move always fails with "423 Locked" while the "ls" is still running. This is how I expect it to work.
  1. mv before ls ("Deadlock found when trying to get lock" in file locking #20555 (comment))
  • Before the fix: deadlock error on one or all files, mv still finished with "423 locked".
  • After the fix: mv continues undisturbed and ls directly returns the old file list and never blocks!

I tried those several times (before and after).

@icewind1991 it looks like your commit fixes the issue ! (or at least my version of it)
So it looks like the scanner itself needs its own exclusive look to prevent double-scanning ?

@nickvergessen
Copy link
Contributor

In mysql client on the CLI:

MariaDB [(none)]> SELECT @@GLOBAL.tx_isolation, @@tx_isolation
    -> ;
+-----------------------+-----------------+
| @@GLOBAL.tx_isolation | @@tx_isolation  |
+-----------------------+-----------------+
| REPEATABLE-READ       | REPEATABLE-READ |
+-----------------------+-----------------+
1 row in set (0.00 sec)

Which is wrong and which is what I said last week already.

#20555 (comment)

As per our docs we need READ_COMMITED
So running

SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

should fix the problem

That should then cause an immediate return with "locked"

@nickvergessen
Copy link
Contributor

Please verify and then close the issue

@PVince81
Copy link
Contributor

As advised, I now ran the commands in CLI mysql and after restarting the CLI session it seems that the values were kept (contrary to my previous belief).

After following the steps from #20555 (comment) the "ls" call still blocks and the log still shows

{"reqId":"f5Qq6fIDKMny4nuH7CV\/","remoteAddr":"127.0.0.1","app":"core","message":"Exception while scanning file \"files\/test\/P1100409.JPG\": An exception occurred while executing 'UPDATE `oc_file_locks` SET `lock` = `lock` + 1, `ttl` = ? WHERE `key` = ? AND `lock` >= 0' with params [1461574469, \"files\\\/09915c88bfd09feb443462ab2efdaed9\"]:\n\nSQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction","level":0,"time":"2016-04-25T07:55:20+00:00","method":"PROPFIND","url":"\/owncloud\/remote.php\/webdav\/test\/","user":"admin"}

@PVince81
Copy link
Contributor

Retested both cases with @icewind1991's PR #24205 and with the proper transaction mode, it still works fine in a non-blocking manner (returns 423 Locked directly)

@PVince81
Copy link
Contributor

It looks like this deadlock was also reproducible with two concurrent "ls" aka PROPFIND on the to-be-rescanned folder: #24260 (comment).

Two concurrent PROPFINDs is more likely to be the cause of this error happening often, since multiple clients might query for changes. This, more often than a MOVE + PROPFIND.

The PR above fixes that too.

@lock
Copy link

lock bot commented Aug 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.