[ 
https://issues.apache.org/jira/browse/GEODE-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kenneth Howe updated GEODE-2472:
--------------------------------
    Description: 
The Oplog.flush(OplogFile olf, ByteBuffer b1, ByteBuffer b2) method doesn't 
check the results of the channel.write() call. The other Oplog.flush() method 
that performs a channel write wraps the write() call in the loop

{code}
do {
    ...
} while (hasRemaining);
{code}

to make sure the Oplog entry is written to the OplogFile.

This method is implemented without the check loop, making the assumption that 
the write() completely writes everything from both buffers. Defensive 
programming would suggest that the results of lower level calls are checked.

Failure to recognize a partial write to the OplogFile can result in a corrupt 
oplog that isn't found until the persistent disk store is recovered.


  was:
The Oplog.flush(OplogFile olf, ByteBuffer b1, ByteBuffer b2) method doesn't 
check the results of the channel.write() call. The other Oplog.flush() method 
that performs a channel write wraps the write() call in the loop

{code}
do {
    ...
} while (hasRemaining);
{code}

to make sure the Oplog entry is wirtten to the OplogFile.

This method is implemented without the check loop, making the assumption that 
the write() completely writes everything from both buffers. Defensive 
programming would suggest that the results of lower level calls are checked.

Failure to recognize a partial write to the OplogFile can result in a corrupt 
oplog that isn't found until the persisten diosk store is recovered.



> Oplog.flush method doesn't verify that the entry gets written
> -------------------------------------------------------------
>
>                 Key: GEODE-2472
>                 URL: https://issues.apache.org/jira/browse/GEODE-2472
>             Project: Geode
>          Issue Type: Improvement
>          Components: persistence
>            Reporter: Kenneth Howe
>
> The Oplog.flush(OplogFile olf, ByteBuffer b1, ByteBuffer b2) method doesn't 
> check the results of the channel.write() call. The other Oplog.flush() method 
> that performs a channel write wraps the write() call in the loop
> {code}
> do {
>     ...
> } while (hasRemaining);
> {code}
> to make sure the Oplog entry is written to the OplogFile.
> This method is implemented without the check loop, making the assumption that 
> the write() completely writes everything from both buffers. Defensive 
> programming would suggest that the results of lower level calls are checked.
> Failure to recognize a partial write to the OplogFile can result in a corrupt 
> oplog that isn't found until the persistent disk store is recovered.



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

Reply via email to