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

Michael Dürig commented on OAK-5135:
------------------------------------

Thanks. Still the flush call should be sufficiently fast. Normal write 
operations are synchronous and explicitly flush full the buffers. The flush 
thread only copes with flushing non full buffers on idle system to avoid too 
much data loss in the case of a crash. Such a flush should never involve more 
than writing a couple of MB of data. 

> The flush of written data via TarRevisions is asynchronous in relation to 
> FileStore.close()
> -------------------------------------------------------------------------------------------
>
>                 Key: OAK-5135
>                 URL: https://issues.apache.org/jira/browse/OAK-5135
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>    Affects Versions: 1.5.13
>            Reporter: Arek Kita
>            Assignee: Francesco Mari
>            Priority: Critical
>             Fix For: 1.6, 1.5.15
>
>
> *Expected behavior*: {{FileStore.close()}} should wait for any written data 
> to be flushed to disk
> *Actual behavior*: {{FileStore.close()}} does not wait for flushing data
> {code:title=Migration log}
> 21.11.2016 12:00:59.792 WARN   o.a.j.o.s.f.Scheduler: The scheduler FileStore 
> background tasks takes too long to shutdown
> 21.11.2016 12:01:10.363 INFO   o.a.j.o.s.f.FileStore: TarMK closed: 
> /data/cq/crx-quickstart/repository-segment-tar-20161121-120039/segmentstore
> 21.11.2016 12:01:10.625 INFO   o.a.j.o.p.s.f.FileStore: TarMK closed: 
> /data/cq/crx-quickstart/repository/segmentstore
> ...
> ### The above directories are swapped/moved here etc ###
> ...
> 21.11.2016 12:01:10.646 WARN   o.a.j.o.s.f.FileStore: Failed to flush the 
> TarMK at 
> /data/cq/crx-quickstart/repository-segment-tar-20161121-120039/segmentstore
> java.io.IOException: Stream Closed
>     at java.io.RandomAccessFile.writeBytes(Native Method) ~[na:1.8.0_101]
>     at java.io.RandomAccessFile.writeBytes(RandomAccessFile.java:1100) 
> ~[na:1.8.0_101]
>     at 
> org.apache.jackrabbit.oak.segment.file.TarRevisions.flush(TarRevisions.java:209)
>  
>     at 
> org.apache.jackrabbit.oak.segment.file.FileStore.flush(FileStore.java:358) 
>     at 
> org.apache.jackrabbit.oak.segment.file.FileStore$2.run(FileStore.java:221) 
>     at 
> org.apache.jackrabbit.oak.segment.file.SafeRunnable.run(SafeRunnable.java:67) 
>     at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> [na:1.8.0_101]
>     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 
> [na:1.8.0_101]
>     at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  [na:1.8.0_101]
>     at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  [na:1.8.0_101]
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_101]
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_101]
>     at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> {code}



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

Reply via email to