Skip to content

Commit

Permalink
add comment for sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
vazois committed Nov 18, 2024
1 parent fb098b6 commit b004fc8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public unsafe void ProcessPrimaryStream(byte* record, int recordLength, long pre

var tail = storeWrapper.appendOnlyFile.TailAddress;
var nextPageBeginAddress = ((tail >> pageSizeBits) + 1) << pageSizeBits;
// Check to ensure:
// 1. if record fits in current page tailAddress of this local node (replica) should be equal to the incoming currentAddress (address of chunk send from primary node)
// 2. if record does not fit in current page start address of the next page matches incoming currentAddress (address of chunk send from primary node)
// otherwise fail and break the connection
if ((tail + recordLength <= nextPageBeginAddress && tail != currentAddress) ||
(tail + recordLength > nextPageBeginAddress && nextPageBeginAddress != currentAddress))
{
Expand Down

0 comments on commit b004fc8

Please sign in to comment.