Francesco Mari commented on OAK-7259:

{quote}Just writing this, I realized that SegmentNodeStoreStats#onCommit is 
only called with the commit semaphore acquired so it won't need additional 
synchronization (in the current implementation of LockBasedScheduler). As for 
onCommitQueued and onCommitDequeued, going forward with the current approach 
means that getQueuedWriters might return an incomplete view of the currently 
queued threads, which should be ok, since this is only about monitoring.{quote}

If no other thread is reading those data structures, every thread passing by 
{{onCommit}} will find the lock free. This will not have a noticeable 
performance overhead for the threads in the commit queue. Thread-safety is 
important to not to report inconsistent data when both reader and writer 
threads access the data structure.

> Improve SegmentNodeStoreStats to include number of commits per thread and 
> threads currently waiting on the semaphore
> --------------------------------------------------------------------------------------------------------------------
>                 Key: OAK-7259
>                 URL: https://issues.apache.org/jira/browse/OAK-7259
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: segment-tar
>            Reporter: Andrei Dulceanu
>            Assignee: Andrei Dulceanu
>            Priority: Major
>              Labels: tooling
>             Fix For: 1.9.0, 1.10
> When investigating the performance of  {{segment-tar}}, the source of the 
> writes (commits) is a very useful indicator of the cause.
> To better understand which threads are currently writing in the repository 
> and which are blocked on the semaphore, we need to improve 
> {{SegmentNodeStoreStats}} to:
>  * expose the number of commits executed per thread
>  * expose threads currently waiting on the semaphore

This message was sent by Atlassian JIRA

Reply via email to