[ 
https://issues.apache.org/jira/browse/ARTEMIS-2414?focusedWorklogId=285445&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-285445
 ]

ASF GitHub Bot logged work on ARTEMIS-2414:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Jul/19 01:55
            Start Date: 31/Jul/19 01:55
    Worklog Time Spent: 10m 
      Work Description: wy96f commented on issue #2769: ARTEMIS-2414 Sync 
before closing file in case data loss
URL: https://github.com/apache/activemq-artemis/pull/2769#issuecomment-516661694
 
 
   > @wy96f I figured out: AIOSequentialFile::close(sync) was not closing the 
file if sync=false. I am fixing it. it's a previous issue that became unveiled 
when you changed the close.
   > 
   > BTW: Did you see .sync actually taking time on a profiling?
   > 
   > The information I had from a few kernel guys is that a sync call when 
there's no sync needed would be moot and not cause any issues. Although I can 
see some barrier between Java and Native layer here.
   > 
   > is that what you saw? a barrier between native and Java, or an actual sync 
ocurring when nothing was needed?
   
   It might not be the actual sync. A few sync calls would not incur perf 
penalty, but a great many would.
   The thing is, during development testing of #2750 , I found message of 
PagedReference was cleared by gc while delivering, which caused reading page 
file to retrieve message. There was no problem in PageReader cache version for 
the cached PageReader is always open. However in PageReader per queue version, 
when we moved to next page meaning the last PageReader was closed and removed, 
we had to reopen PageReader to retrieve message. This resulted in lots of sync 
when opening and closing, and perf penalty was emerging.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 285445)
    Time Spent: 3.5h  (was: 3h 20m)

> Sync before closing file in case data loss
> ------------------------------------------
>
>                 Key: ARTEMIS-2414
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2414
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.9.0
>            Reporter: yangwei
>            Priority: Major
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> When we open a new page, the page sync timer might sync the current page, 
> i.e. the new page and after it responses are sent back to client. And the old 
> page is closed(not synced), we may lose messages if server crashes before 
> dirty page cache written back into disk.
> When we switch journal file to the new file, TimedBuffer::flushBatch will be 
> called in the old file. Then the file would be synced except in the case user 
> sets "journalDatasync" to false. For safety we'd better sync journal file 
> before closing it.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to