Skip to content

Commit

Permalink
ARTEMIS-3282 save fdatasync on page close/lrg msg end
Browse files Browse the repository at this point in the history
  • Loading branch information
franz1981 committed May 20, 2021
1 parent 8060be5 commit ca90b5d
Showing 1 changed file with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ private void handleLargeMessageEnd(final ReplicationLargeMessageEndMessage packe
if (logger.isTraceEnabled()) {
logger.trace("Closing LargeMessage " + packet.getMessageId() + " on the executor @ handleLargeMessageEnd");
}
message.releaseResources(true, false);
message.releaseResources(false, false);
} else {
executor.execute(new Runnable() {
@Override
Expand Down Expand Up @@ -815,27 +815,20 @@ private void handleAppendAddRecord(final ReplicationAddMessage packet) throws Ex
* @param packet
*/
private void handlePageEvent(final ReplicationPageEventMessage packet) throws Exception {
ConcurrentMap<Integer, Page> pages = getPageMap(packet.getStoreName());

Page page = pages.remove(packet.getPageNumber());
Page page = getPageMap(packet.getStoreName()).remove(packet.getPageNumber());

if (page == null) {
// if page is null, we create it the instance and include it on the map
// then we must recurse this call
// so page.delete or page.close will not leave any closed objects on the hashmap
getPage(packet.getStoreName(), packet.getPageNumber());
handlePageEvent(packet);
return;
// if page is null, we create it: no need to put it on page map just to remove it again
page = pageManager.getPageStore(packet.getStoreName()).createPage(packet.getPageNumber());
page.open();
}

if (page != null) {
if (packet.isDelete()) {
if (deletePages) {
page.delete(null);
}
} else {
page.close(false);
if (packet.isDelete()) {
if (deletePages) {
page.delete(null);
}
} else {
page.close(false, false);
}

}
Expand Down

0 comments on commit ca90b5d

Please sign in to comment.