Program: 8001
Project: 8001
Buggy source:
private void readEntries(QueueConsumer consumer,QueueConfig config,QueueStateImpl queueState,ReadPointer readPointer,List<Long> entryIds) throws OperationException {
  if (LOG.isTraceEnabled()) {
    LOG.trace(getLogMessage(String.format("String_Node_Str",entryIds)));
  }
  Map<Long,byte[]> currentCachedEntries=queueState.getTransientWorkingSet().getCachedEntries();
  Map<Long,byte[]> newCachedEntries=Maps.newHashMap();
  for (  long entryId : queueState.getDequeueEntrySet().getEntryIds()) {
    byte[] entry=currentCachedEntries.get(entryId);
    if (entry != null) {
      newCachedEntries.put(entryId,entry);
    }
  }
  List<Long> readEntryIds=Lists.newArrayListWithCapacity(entryIds.size());
  try {
    if (entryIds.isEmpty()) {
      return;
    }
    final byte[][] entryRowKeys=new byte[entryIds.size()][];
    for (int i=0; i < entryIds.size(); ++i) {
      entryRowKeys[i]=makeRowKey(GLOBAL_DATA_PREFIX,entryIds.get(i));
    }
    final byte[][] entryColKeys=new byte[][]{ENTRY_META,ENTRY_DATA};
    OperationResult<Map<byte[],Map<byte[],byte[]>>> entriesResult=this.table.getAllColumns(entryRowKeys,entryColKeys,readPointer);
    if (entriesResult.isEmpty()) {
    }
 else {
      for (int i=0; i < entryIds.size(); ++i) {
        Map<byte[],byte[]> entryMap=entriesResult.getValue().get(entryRowKeys[i]);
        if (entryMap == null) {
          if (LOG.isTraceEnabled()) {
            LOG.trace(getLogMessage(String.format("String_Node_Str",entryIds.get(i))));
          }
          return;
        }
        byte[] entryMetaBytes=entryMap.get(ENTRY_META);
        if (entryMetaBytes == null) {
          if (LOG.isTraceEnabled()) {
            LOG.trace(getLogMessage(String.format("String_Node_Str",entryIds.get(i))));
          }
          return;
        }
        EntryMeta entryMeta=EntryMeta.fromBytes(entryMetaBytes);
        if (LOG.isTraceEnabled()) {
          LOG.trace(getLogMessage("String_Node_Str" + entryIds.get(i) + "String_Node_Str"+ entryMeta.toString()));
        }
        if (entryMeta.isInvalid() || entryMeta.isEvicted()) {
          if (LOG.isTraceEnabled()) {
            LOG.trace(getLogMessage("String_Node_Str" + entryIds.get(i) + "String_Node_Str"+ entryMeta.toString()+ "String_Node_Str"));
          }
        }
 else {
          assert(entryMeta.isValid());
          long entryId=entryIds.get(i);
          byte[] entryData=entryMap.get(ENTRY_DATA);
          newCachedEntries.put(entryId,entryData);
          readEntryIds.add(entryId);
        }
      }
    }
  }
  finally {
    queueState.setTransientWorkingSet(new TransientWorkingSet(readEntryIds,newCachedEntries));
  }
}

Fixed version (ground truth):
/** 
 * @returns true if all entries were skipped because they are invalid or evicted. That means we have to move theconsumer past these entries and fetch again.
 */
protected boolean readEntries(QueueConsumer consumer,QueueConfig config,QueueStateImpl queueState,ReadPointer readPointer,List<Long> entryIds) throws OperationException {
  if (LOG.isTraceEnabled()) {
    LOG.trace(getLogMessage(String.format("String_Node_Str",entryIds)));
  }
  if (entryIds.isEmpty()) {
    return false;
  }
  Map<Long,byte[]> currentCachedEntries=queueState.getTransientWorkingSet().getCachedEntries();
  Map<Long,byte[]> newCachedEntries=Maps.newHashMap();
  for (  long entryId : queueState.getDequeueEntrySet().getEntryIds()) {
    byte[] entry=currentCachedEntries.get(entryId);
    if (entry != null) {
      newCachedEntries.put(entryId,entry);
    }
  }
  List<Long> readEntryIds=Lists.newArrayListWithCapacity(entryIds.size());
  try {
    final byte[][] entryRowKeys=new byte[entryIds.size()][];
    for (int i=0; i < entryIds.size(); ++i) {
      entryRowKeys[i]=makeRowKey(GLOBAL_DATA_PREFIX,entryIds.get(i));
    }
    final byte[][] entryColKeys=new byte[][]{ENTRY_META,ENTRY_DATA};
    OperationResult<Map<byte[],Map<byte[],byte[]>>> entriesResult=table.getAllColumns(entryRowKeys,entryColKeys,readPointer);
    if (entriesResult.isEmpty()) {
      return false;
    }
 else {
      boolean allInvalid=true;
      for (int i=0; i < entryIds.size(); ++i) {
        Map<byte[],byte[]> entryMap=entriesResult.getValue().get(entryRowKeys[i]);
        if (entryMap == null) {
          if (LOG.isTraceEnabled()) {
            LOG.trace(getLogMessage(String.format("String_Node_Str",entryIds.get(i))));
          }
          return false;
        }
        byte[] entryMetaBytes=entryMap.get(ENTRY_META);
        if (entryMetaBytes == null) {
          if (LOG.isTraceEnabled()) {
            LOG.trace(getLogMessage(String.format("String_Node_Str",entryIds.get(i))));
          }
          return false;
        }
        EntryMeta entryMeta=EntryMeta.fromBytes(entryMetaBytes);
        if (LOG.isTraceEnabled()) {
          LOG.trace(getLogMessage("String_Node_Str" + entryIds.get(i) + "String_Node_Str"+ entryMeta.toString()));
        }
        if (entryMeta.isInvalid() || entryMeta.isEvicted()) {
          if (LOG.isTraceEnabled()) {
            LOG.trace(getLogMessage("String_Node_Str" + entryIds.get(i) + "String_Node_Str"+ entryMeta.toString()+ "String_Node_Str"));
          }
        }
 else {
          assert(entryMeta.isValid());
          long entryId=entryIds.get(i);
          byte[] entryData=entryMap.get(ENTRY_DATA);
          newCachedEntries.put(entryId,entryData);
          readEntryIds.add(entryId);
          allInvalid=false;
        }
      }
      return allInvalid;
    }
  }
  finally {
    queueState.setTransientWorkingSet(new TransientWorkingSet(readEntryIds,newCachedEntries));
  }
}