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

ASF GitHub Bot commented on GEODE-2398:
---------------------------------------

Github user agingade commented on a diff in the pull request:

    https://github.com/apache/geode/pull/477#discussion_r113087379
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/internal/cache/OverflowOplog.java ---
    @@ -724,8 +727,31 @@ public final void flush() throws IOException {
             if (bb != null && bb.position() != 0) {
               bb.flip();
               int flushed = 0;
    +          int numChannelRetries = 0;
               do {
    -            flushed += olf.channel.write(bb);
    +            int channelBytesWritten = 0;
    +            final int bbStartPos = bb.position();
    +            final long channelStartPos = olf.channel.position();
    +            // differentiate between bytes written on this channel.write() 
iteration and the
    +            // total number of bytes written to the channel on this call
    +            channelBytesWritten += olf.channel.write(bb);
    --- End diff --
    
    Instead of "+="; we could just assign the value...Its not really makes any 
difference; its just when you read this line, you don't have to know its 
previous value...


> Sporadic Oplog corruption due to channel.write failure
> ------------------------------------------------------
>
>                 Key: GEODE-2398
>                 URL: https://issues.apache.org/jira/browse/GEODE-2398
>             Project: Geode
>          Issue Type: Bug
>          Components: persistence
>            Reporter: Kenneth Howe
>            Assignee: Anilkumar Gingade
>             Fix For: 1.2.0
>
>
> There have been some occurrences of Oplog corruption during testing that have 
> been traced to failures in writing oplog entries to the .crf file. When it 
> fails, Oplog.flush attempts to write a ByteBuffer to the file channel. The 
> call to channel.write(bb) method returns 0 bytes written, but the source 
> ByteBuffer position is moved to the ByteBuffer limit.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to