Program: 10358
Project: 10358
Buggy source:
public boolean store(byte[] id,long partitionId,byte[] value,boolean callback){
  storeRequests.mark();
  final Timer.Context context=storeTimer.time();
  try {
    if (doNothing)     return true;
    long nextSeqId=-1;
    StorePartition storePartition=PistachiosServer.storePartitionMap.get(partitionId);
    if (storePartition == null) {
      logger.info("String_Node_Str",partitionId);
      return false;
    }
    if ((nextSeqId=storePartition.getNextSeqId()) == -1) {
      return false;
    }
    String partitionTopic=KAFKA_TOPIC_PREFIX + partitionId;
    KeyValue kv=new KeyValue();
    kv.key=id;
    kv.seqId=nextSeqId;
    kv.value=value;
    kv.callback=callback;
    long lockKey=(id.hashCode() * 7 + 11) % 1024;
    lockKey=lockKey >= 0 ? lockKey : lockKey + 1024;
    if (kv.callback && StoreCallbackRegistry.getInstance().getStoreCallback().needCallback()) {
synchronized (storePartition.getKeyLock((int)lockKey)) {
        logger.debug("String_Node_Str",kv.key,kv.value,kv.seqId,storePartition.getSeqId());
        byte[] currentValue=(storePartition.getFromWriteCache(id) != null) ? storePartition.getFromWriteCache(id).value : null;
        kv.value=StoreCallbackRegistry.getInstance().getStoreCallback().onStore(id,currentValue,value);
        if (kv.value != null) {
          PistachiosServer.storePartitionMap.get(partitionId).getWriteCache().putIfAbsent(new ByteArrayWrapper(id,id.length),kv);
        }
        KeyedMessage<String,KeyValue> message=new KeyedMessage<String,KeyValue>(partitionTopic,kv);
        getKafkaProducerInstance(partitionId).send(message);
      }
    }
 else {
      logger.debug("String_Node_Str",kv.key,kv.value,kv.seqId,PistachiosServer.storePartitionMap.get(partitionId).getSeqId());
      PistachiosServer.storePartitionMap.get(partitionId).getWriteCache().put(new ByteArrayWrapper(id,id.length),kv);
      KeyedMessage<String,KeyValue> message=new KeyedMessage<String,KeyValue>(partitionTopic,kv);
      getKafkaProducerInstance(partitionId).send(message);
    }
    logger.debug("String_Node_Str",PistachiosServer.storePartitionMap.get(partitionId).getSeqId(),kv.seqId);
    while (kv.seqId - PistachiosServer.storePartitionMap.get(partitionId).getSeqId() > 20000000) {
      logger.debug("String_Node_Str",PistachiosServer.storePartitionMap.get(partitionId).getSeqId(),kv.seqId);
      Thread.sleep(30);
    }
    return true;
  }
 catch (  Exception e) {
    logger.info("String_Node_Str",DefaultDataInterpreter.getDataInterpreter().interpretId(id),DefaultDataInterpreter.getDataInterpreter().interpretData(value),e);
    storeFailureRequests.mark();
    return false;
  }
 finally {
    context.stop();
  }
}

Fixed version (ground truth):
public boolean store(byte[] id,long partitionId,byte[] value,boolean callback){
  storeRequests.mark();
  final Timer.Context context=storeTimer.time();
  try {
    if (doNothing)     return true;
    long nextSeqId=-1;
    StorePartition storePartition=PistachiosServer.storePartitionMap.get(partitionId);
    if (storePartition == null) {
      logger.info("String_Node_Str",partitionId);
      return false;
    }
    if ((nextSeqId=storePartition.getNextSeqId()) == -1) {
      return false;
    }
    String partitionTopic=KAFKA_TOPIC_PREFIX + partitionId;
    KeyValue kv=new KeyValue();
    kv.key=id;
    kv.seqId=nextSeqId;
    kv.value=value;
    kv.callback=callback;
    long lockKey=(id.hashCode() * 7 + 11) % 1024;
    lockKey=lockKey >= 0 ? lockKey : lockKey + 1024;
    if (kv.callback && StoreCallbackRegistry.getInstance().getStoreCallback().needCallback()) {
synchronized (storePartition.getKeyLock((int)lockKey)) {
        logger.debug("String_Node_Str",kv.key,kv.value,kv.seqId,storePartition.getSeqId());
        byte[] currentValue=(storePartition.getFromWriteCache(id) != null) ? storePartition.getFromWriteCache(id).value : null;
        if (currentValue == null) {
          byte[] toRet=PistachiosServer.getInstance().getLocalStorageEngine().get(id,(int)partitionId);
          if (null != toRet) {
            Input input=new Input(toRet);
            ValueOffset valueOffset=kryo.readObject(input,ValueOffset.class);
            input.close();
            logger.debug("String_Node_Str",toRet,valueOffset);
            currentValue=valueOffset.value;
          }
        }
        kv.value=StoreCallbackRegistry.getInstance().getStoreCallback().onStore(id,currentValue,value);
        if (kv.value != null) {
          PistachiosServer.storePartitionMap.get(partitionId).getWriteCache().putIfAbsent(new ByteArrayWrapper(id,id.length),kv);
        }
        kv.value=value;
        KeyedMessage<String,KeyValue> message=new KeyedMessage<String,KeyValue>(partitionTopic,kv);
        getKafkaProducerInstance(partitionId).send(message);
      }
    }
 else {
      logger.debug("String_Node_Str",kv.key,kv.value,kv.seqId,PistachiosServer.storePartitionMap.get(partitionId).getSeqId());
      PistachiosServer.storePartitionMap.get(partitionId).getWriteCache().put(new ByteArrayWrapper(id,id.length),kv);
      KeyedMessage<String,KeyValue> message=new KeyedMessage<String,KeyValue>(partitionTopic,kv);
      getKafkaProducerInstance(partitionId).send(message);
    }
    logger.debug("String_Node_Str",PistachiosServer.storePartitionMap.get(partitionId).getSeqId(),kv.seqId);
    while (kv.seqId - PistachiosServer.storePartitionMap.get(partitionId).getSeqId() > 20000000) {
      logger.debug("String_Node_Str",PistachiosServer.storePartitionMap.get(partitionId).getSeqId(),kv.seqId);
      Thread.sleep(30);
    }
    return true;
  }
 catch (  Exception e) {
    logger.info("String_Node_Str",DefaultDataInterpreter.getDataInterpreter().interpretId(id),DefaultDataInterpreter.getDataInterpreter().interpretData(value),e);
    storeFailureRequests.mark();
    return false;
  }
 finally {
    context.stop();
  }
}