Skip to content

Commit

Permalink
IGNITE-8114 Additional fix for Add fail recovery mechanism to trackin…
Browse files Browse the repository at this point in the history
…g pages
  • Loading branch information
Eduard Shangareev authored and dspavlov committed Apr 9, 2018
1 parent abfa0f5 commit 961fc35
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -86,9 +86,11 @@ protected TrackingPageIO(int ver) {
* @param pageId Page id.
* @param nextSnapshotTag Tag of next snapshot.
* @param pageSize Page size.
*
* @return <code>-1</code> if everything is ok, otherwise last saved tag.
*/
public void markChanged(ByteBuffer buf, long pageId, long nextSnapshotTag, long lastSuccessfulSnapshotTag, int pageSize) {
validateSnapshotTag(buf, nextSnapshotTag, lastSuccessfulSnapshotTag, pageSize);
public long markChanged(ByteBuffer buf, long pageId, long nextSnapshotTag, long lastSuccessfulSnapshotTag, int pageSize) {
long tag = validateSnapshotTag(buf, nextSnapshotTag, lastSuccessfulSnapshotTag, pageSize);

int cntOfPage = countOfPageToTrack(pageSize);

Expand All @@ -105,7 +107,7 @@ public void markChanged(ByteBuffer buf, long pageId, long nextSnapshotTag, long
byte newVal = (byte) (byteToUpdate | updateTemplate);

if (byteToUpdate == newVal)
return;
return tag;

buf.put(idx, newVal);

Expand All @@ -114,6 +116,8 @@ public void markChanged(ByteBuffer buf, long pageId, long nextSnapshotTag, long
buf.putShort(sizeOff, newSize);

assert newSize == countOfChangedPage(buf, nextSnapshotTag, pageSize);

return tag;
}

/**
Expand Down

0 comments on commit 961fc35

Please sign in to comment.