[ https://issues.apache.org/jira/browse/OAK-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15385662#comment-15385662 ]
Andrei Dulceanu commented on OAK-4105: -------------------------------------- As an alternate solution, we might think about why this line from {{FileStore::writeSegment}} doesn't increase {{approximateSize}} by the correct value: https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java#L1299. I took a look at how the bytes written are reported to {{FileStoreMonitor}} in https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/TarWriter.java#L281, but honestly I don't know if these two are equivalent or not. If they are not, maybe there's a way to use the same approach for updating {{approximateSize}}. > Implement FileStore.size through FileStore.approximateSize > ---------------------------------------------------------- > > Key: OAK-4105 > URL: https://issues.apache.org/jira/browse/OAK-4105 > Project: Jackrabbit Oak > Issue Type: Technical task > Components: segment-tar > Reporter: Michael Dürig > Assignee: Andrei Dulceanu > Priority: Minor > Labels: resilience > Fix For: Segment Tar 0.0.6 > > Attachments: OAK-4105-01.patch, OAK-4105-02.patch > > > {{FileStore.size()}} is prone to lock contention and should not be called too > often. As OAK-2879 already introduced an approach for tracking the current > size of the file store without having to lock, we might as well promote his > to be "the official" implementation. > [~frm] WDYT? -- This message was sent by Atlassian JIRA (v6.3.4#6332)