Program: 8167
Project: 8167
Buggy source:
@Override public EnqueueResult enqueue(byte[] data,long cleanWriteVersion){
  log("String_Node_Str" + data.length + "String_Node_Str"+ cleanWriteVersion+ "String_Node_Str");
  ImmutablePair<ReadPointer,Long> dirty=dirtyPointer();
  long entryId=this.table.increment(makeRow(GLOBAL_ENTRY_HEADER),GLOBAL_ENTRYID_COUNTER,1,dirty.getFirst(),dirty.getSecond());
  log("String_Node_Str" + entryId);
  byte[] entryWritePointerRow=makeRow(GLOBAL_ENTRY_WRITEPOINTER_HEADER);
  while (getCounter(entryWritePointerRow,GLOBAL_ENTRYID_WRITEPOINTER_COUNTER,dirty.getFirst()) != (entryId - 1)) {
    log("String_Node_Str");
    quickWait();
  }
  log("String_Node_Str" + entryId);
  ShardMeta shardMeta=null;
  boolean movedShards=false;
  byte[] shardMetaRow=makeRow(GLOBAL_SHARDS_HEADER);
  if (entryId == 1) {
    shardMeta=new ShardMeta(1,data.length,1);
    log("String_Node_Str");
  }
 else {
    shardMeta=ShardMeta.fromBytes(this.table.get(shardMetaRow,GLOBAL_SHARD_META,dirty.getFirst()));
    log("String_Node_Str" + shardMeta.toString());
    if ((shardMeta.getShardBytes() + data.length > this.maxBytesPerShard && shardMeta.getShardEntries() > 1) || shardMeta.getShardEntries() == this.maxEntriesPerShard) {
      movedShards=true;
      shardMeta=new ShardMeta(shardMeta.getShardId() + 1,data.length,1);
      log("String_Node_Str");
    }
 else {
      shardMeta=new ShardMeta(shardMeta.getShardId(),shardMeta.getShardBytes() + data.length,shardMeta.getShardEntries() + 1);
    }
  }
  this.table.put(shardMetaRow,GLOBAL_SHARD_META,dirty.getSecond(),shardMeta.getBytes());
  long newWritePointer=this.table.increment(entryWritePointerRow,GLOBAL_ENTRYID_WRITEPOINTER_COUNTER,1,dirty.getFirst(),dirty.getSecond());
  log("String_Node_Str" + shardMeta + "String_Node_Str"+ "String_Node_Str"+ newWritePointer);
  if (movedShards) {
    this.table.put(makeRow(GLOBAL_DATA_HEADER,shardMeta.getShardId() - 1),makeColumn(entryId,ENTRY_META),cleanWriteVersion,new EntryMeta(EntryState.SHARD_END).getBytes());
    log("String_Node_Str" + shardMeta);
  }
  this.table.put(makeRow(GLOBAL_DATA_HEADER,shardMeta.getShardId()),new byte[][]{makeColumn(entryId,ENTRY_META),makeColumn(entryId,ENTRY_DATA)},cleanWriteVersion,new byte[][]{new EntryMeta(EntryState.VALID).getBytes(),data});
  return new EnqueueResult(EnqueueStatus.SUCCESS,new QueueEntryPointer(queueName,entryId,shardMeta.getShardId()));
}

Fixed version (ground truth):
@Override public EnqueueResult enqueue(byte[] data,long cleanWriteVersion){
  log("String_Node_Str" + data.length + "String_Node_Str"+ cleanWriteVersion+ "String_Node_Str");
  ImmutablePair<ReadPointer,Long> dirty=dirtyPointer();
  long entryId=this.table.increment(makeRow(GLOBAL_ENTRY_HEADER),GLOBAL_ENTRYID_COUNTER,1,dirty.getFirst(),dirty.getSecond());
  log("String_Node_Str" + entryId);
  byte[] entryWritePointerRow=makeRow(GLOBAL_ENTRY_WRITEPOINTER_HEADER);
  while (getCounter(entryWritePointerRow,GLOBAL_ENTRYID_WRITEPOINTER_COUNTER,dirty.getFirst()) != (entryId - 1)) {
    log("String_Node_Str");
    quickWait();
  }
  log("String_Node_Str" + entryId);
  ShardMeta shardMeta=null;
  boolean movedShards=false;
  byte[] shardMetaRow=makeRow(GLOBAL_SHARDS_HEADER);
  if (entryId == 1) {
    shardMeta=new ShardMeta(1,data.length,1);
    log("String_Node_Str");
  }
 else {
    shardMeta=ShardMeta.fromBytes(this.table.get(shardMetaRow,GLOBAL_SHARD_META,dirty.getFirst()));
    log("String_Node_Str" + shardMeta.toString());
    if ((shardMeta.getShardBytes() + data.length > this.maxBytesPerShard && shardMeta.getShardEntries() > 1) || shardMeta.getShardEntries() == this.maxEntriesPerShard) {
      movedShards=true;
      shardMeta=new ShardMeta(shardMeta.getShardId() + 1,data.length,1);
      log("String_Node_Str");
    }
 else {
      shardMeta=new ShardMeta(shardMeta.getShardId(),shardMeta.getShardBytes() + data.length,shardMeta.getShardEntries() + 1);
    }
  }
  this.table.put(shardMetaRow,GLOBAL_SHARD_META,dirty.getSecond(),shardMeta.getBytes());
  long newWritePointer=this.table.increment(entryWritePointerRow,GLOBAL_ENTRYID_WRITEPOINTER_COUNTER,1,dirty.getFirst(),dirty.getSecond());
  log("String_Node_Str" + shardMeta + "String_Node_Str"+ "String_Node_Str"+ newWritePointer);
  if (movedShards) {
    this.table.put(makeRow(GLOBAL_DATA_HEADER,shardMeta.getShardId() - 1),makeColumn(entryId,ENTRY_META),cleanWriteVersion,new EntryMeta(EntryState.SHARD_END).getBytes());
    log("String_Node_Str" + shardMeta);
  }
  this.table.put(makeRow(GLOBAL_DATA_HEADER,shardMeta.getShardId()),new byte[][]{makeColumn(entryId,ENTRY_DATA),makeColumn(entryId,ENTRY_META)},cleanWriteVersion,new byte[][]{data,new EntryMeta(EntryState.VALID).getBytes()});
  return new EnqueueResult(EnqueueStatus.SUCCESS,new QueueEntryPointer(queueName,entryId,shardMeta.getShardId()));
}