[ 
https://issues.apache.org/jira/browse/OAK-3612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15010863#comment-15010863
 ] 

Francesco Mari commented on OAK-3612:
-------------------------------------

The deadlock is more complicated than expected. It boils down to a call to 
{{SegmentWriter#flush}} performed while holding the implicit lock for the 
{{SegmentWriter}}. This deadlock is not easy to solve without going through a 
refactoring of the {{SegmentWriter}}, which should be the scope of OAK-1828.

I run my tests using the less invasive solution proposed by [~alex.parvulescu], 
obtaining good results. The standby node is now able to delete the 
pre-compacted state when the cleanup operation is triggered through the JMX 
bean.

{noformat}
18.11.2015 12:59:26.520 *INFO* [RMI TCP Connection(16)-10.132.4.207] 
org.apache.jackrabbit.oak.plugins.segment.file.FileStore TarMK GC #0: cleanup 
started. Current repository size is 1.2 GB (1249641472 bytes)
18.11.2015 12:59:26.773 *INFO* [RMI TCP Connection(16)-10.132.4.207] 
org.apache.jackrabbit.oak.plugins.segment.file.TarReader-GC Cleaned segments 
from data00005a.tar: 
        e724aad7-dbf4-441b-a451-b92f0516c156, 
35e3c300-00ea-4477-a005-e37db181c664, fd130fc5-0b2c-432b-a9b8-6b6167ff8312, 
9ed0e54d-e3ab-4ef3-ad15-136781fb4b6b, 
        c4e93c7f-754d-4f6d-a9ff-51e5bac7acec, 
0512412d-ea96-4eea-ac9d-8e401ea35914, c523dcd2-1e31-495e-a15f-0ceaee0e66ec, 
4c54a6f4-3c12-41a2-ac25-9d45dff38fa8, 
        edc6a4cf-c358-4fef-a043-90857135e760, 
beeafeda-3486-4931-a58e-c57e41e5c51c, 7e63ecc3-2ab5-407e-a86b-896ca1f7e895, 
1dd480ee-efe0-4757-afec-1e290af3f8c9, 
        5e245021-67be-4266-af9c-347d5032e79c, 
ef99a42b-3c37-4ac3-ae50-0de8aa441d29, efbdd640-4c04-4ef7-a21b-4fc3db8ee96b, 
0decb0ae-88bf-4897-a102-15f97e015084, 
        59ad4f38-3f70-44fc-a013-f259ebf1ca36, 
ab78d2db-426f-42dc-a03f-9f23e24b4c32, 6e4b1472-5af2-4a1e-a2d3-47a19c1bd109, 
58f50b51-458e-4931-aca5-3a78f849a0b9, 
        68212eb1-c960-421c-a7cf-3e91ba9114f5, 
c52df7b9-93cc-421b-aa83-d70523ca3476
18.11.2015 12:59:26.783 *INFO* [RMI TCP Connection(16)-10.132.4.207] 
org.apache.jackrabbit.oak.plugins.segment.file.FileStore TarMK GC #0: cleanup 
marking file for deletion: data00005a.tar
18.11.2015 12:59:26.783 *INFO* [RMI TCP Connection(16)-10.132.4.207] 
org.apache.jackrabbit.oak.plugins.segment.file.FileStore TarMK GC #0: cleanup 
completed in 263.8 ms (263 ms). Post cleanup size is 1.2 GB (1249584128 bytes) 
and space reclaimed 57.3 kB (57344 bytes). Compaction map weight/depth is 0 B/0 
(0 bytes/0).
{noformat}

I will perform some more tests, but the fix seems to be effective so far.

> The string/template cache of the SegmentWriter should be cleared before 
> cleanup
> -------------------------------------------------------------------------------
>
>                 Key: OAK-3612
>                 URL: https://issues.apache.org/jira/browse/OAK-3612
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segmentmk
>            Reporter: Francesco Mari
>             Fix For: 1.4
>
>         Attachments: OAK-3612-01.patch
>
>
> The string/template cache of the SegmentWriter 
> (org.apache.jackrabbit.oak.plugins.segment.SegmentWriter#records) is not 
> cleared before the cleanup phase. This might maintain in-memory references to 
> segments, thus preventing them to be cleaned up.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to