// write previous sync marker to point to next sync marker
// we don't chain the crcs here to ensure this method is idempotent if it fails
int offset = lastSyncedOffset;
final PureJavaCrc32 crc = new PureJavaCrc32();
crc.update((int) (id & 0xFFFFFFFFL));
crc.update((int) (id >>> 32));
crc.update(offset);
buffer.putInt(offset, nextMarker);
buffer.putLong(offset + 4, crc.getValue());
// zero out the next sync marker so replayer can cleanly exit