Program: 30866
Project: 30866
Buggy source:
private void cancelRow(){
  if ((masterRef & 1) == 0) {
    return;
  }
  if (transientRowCount == 0) {
    if (partitionBy != PartitionBy.NONE) {
      closeColumns(false);
      if (removeDirOnCancelRow) {
        try {
          setStateForTimestamp(maxTimestamp,false);
          if (!ff.rmdir(path.$())) {
            throw CairoException.instance(ff.errno()).put("String_Node_Str").put(path);
          }
          removeDirOnCancelRow=false;
        }
  finally {
          path.trimTo(rootLen);
        }
      }
      if (prevTimestamp > Long.MIN_VALUE) {
        try {
          columnSizeMem.jumpTo((txPartitionCount - 2) * 16);
          openPartition(prevTimestamp);
          setAppendPosition(prevTransientRowCount);
          txPartitionCount--;
        }
 catch (        CairoException e) {
          closeColumns(false);
          throw e;
        }
      }
 else {
        rowFunction=openPartitionFunction;
      }
      transientRowCount=prevTransientRowCount;
      fixedRowCount-=prevTransientRowCount;
      maxTimestamp=prevTimestamp;
      removeDirOnCancelRow=true;
    }
 else {
      for (int i=0; i < columnCount; i++) {
        getPrimaryColumn(i).jumpTo(0);
        AppendMemory mem=getSecondaryColumn(i);
        if (mem != null) {
          mem.jumpTo(0);
        }
      }
    }
  }
 else {
    maxTimestamp=prevTimestamp;
    boolean rowChanged=false;
    for (int i=0; i < columnCount; i++) {
      if (refs.getQuick(i) == masterRef) {
        rowChanged=true;
        break;
      }
    }
    if (rowChanged) {
      setAppendPosition(transientRowCount);
    }
  }
  masterRef--;
}

Fixed version (ground truth):
private void cancelRow(){
  if ((masterRef & 1) == 0) {
    return;
  }
  if (transientRowCount == 0) {
    if (partitionBy != PartitionBy.NONE) {
      closeColumns(false);
      if (removeDirOnCancelRow) {
        try {
          setStateForTimestamp(maxTimestamp,false);
          if (!ff.rmdir(path.$())) {
            throw CairoException.instance(ff.errno()).put("String_Node_Str").put(path);
          }
          removeDirOnCancelRow=false;
        }
  finally {
          path.trimTo(rootLen);
        }
      }
      if (prevTimestamp > Long.MIN_VALUE) {
        try {
          columnSizeMem.jumpTo((txPartitionCount - 2) * 16);
          openPartition(prevTimestamp);
          setAppendPosition(prevTransientRowCount);
          txPartitionCount--;
        }
 catch (        CairoException e) {
          closeColumns(false);
          throw e;
        }
      }
 else {
        rowFunction=openPartitionFunction;
      }
      transientRowCount=prevTransientRowCount;
      fixedRowCount-=prevTransientRowCount;
      maxTimestamp=prevTimestamp;
      removeDirOnCancelRow=true;
    }
 else {
      maxTimestamp=prevTimestamp;
      for (int i=0; i < columnCount; i++) {
        getPrimaryColumn(i).setSize(0);
        AppendMemory mem=getSecondaryColumn(i);
        if (mem != null) {
          mem.setSize(0);
        }
      }
    }
  }
 else {
    maxTimestamp=prevTimestamp;
    boolean rowChanged=false;
    for (int i=0; i < columnCount; i++) {
      if (refs.getQuick(i) == masterRef) {
        rowChanged=true;
        break;
      }
    }
    if (rowChanged) {
      setAppendPosition(transientRowCount);
    }
  }
  refs.fill(0,columnCount,--masterRef);
}