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

Ivan Kelly commented on BOOKKEEPER-563:
---------------------------------------

{quote}
there are bunch of os doesn't support posix_fadvise.
http://www.gnu.org/software/gnulib/manual/html_node/posix_005ffadvise.html

it would fail tests on mac if we don't have os checking.
http://mail-archives.apache.org/mod_mbox/cassandra-user/201104.mbox/%[email protected]%3E
{quote}
Indeed. Anything not supporting "_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 
200112L" wont have it. But whether it has it or not is easy to test without 
having to revert to checking the OS. If you call posix_fadvise on a system that 
doesn't have it, you'll get
{code}
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up 
function 'posix_fadvise': java: undefined symbol: posix_fadvise
        at com.sun.jna.Function.<init>(Function.java:179)
        at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:344)
        at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:324)
        at com.sun.jna.Native.register(Native.java:1341)
        at com.sun.jna.Native.register(Native.java:1018)
        at testjna.main(testjna.java:16)
{code}
which can be caught. 

{code}
if (hasFadvise) {
    try {
        posix_fadvise(sysFileDesc, offset, len, POSIX_FADV_DONTNEED);
    } catch (UnsatisfiedLinkError ule) {
        LOG.info("posix_fadvise not found");
        hasFadvise = false;
    }
}
{code}
Having said that, I don't think this is worth blocking the patch for, so +1 on 
the patch. We can create another JIRA to resolve this issue. Also, I think the 
-1 for the tests is fine in this case.

                
> Avoid Journal polluting page cache
> ----------------------------------
>
>                 Key: BOOKKEEPER-563
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-563
>             Project: Bookkeeper
>          Issue Type: Improvement
>            Reporter: Sijie Guo
>            Assignee: Robin Dhamankar
>             Fix For: 4.3.0
>
>         Attachments: BOOKKEEPER-563.diff, BOOKKEEPER-563.reverse.diff, 
> BOOKKEEPER-563.reverse.diff
>
>
> writing data into journal which force the data in os buffer cache being used 
> for hot reads, which could have negative affect on performance.
> similar solution is as CASSANDRA-1470.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to