Program: 60821
Project: 60821
Buggy source:
private synchronized void flushConfig(Map<String,RSGroupInfo> newGroupMap) throws IOException {
  Map<TableName,String> newTableMap;
  if (!isOnline()) {
    Map<String,RSGroupInfo> m=Maps.newHashMap(rsGroupMap);
    RSGroupInfo oldDefaultGroup=m.remove(RSGroupInfo.DEFAULT_GROUP);
    RSGroupInfo newDefaultGroup=newGroupMap.remove(RSGroupInfo.DEFAULT_GROUP);
    if (!m.equals(newGroupMap) || !oldDefaultGroup.getTables().equals(newDefaultGroup.getTables())) {
      throw new IOException("String_Node_Str");
    }
    newGroupMap.put(RSGroupInfo.DEFAULT_GROUP,newDefaultGroup);
    rsGroupMap=newGroupMap;
    return;
  }
  newTableMap=flushConfigTable(newGroupMap);
  resetRSGroupAndTableMaps(newGroupMap,newTableMap);
  try {
    String groupBasePath=ZNodePaths.joinZNode(watcher.znodePaths.baseZNode,rsGroupZNode);
    ZKUtil.createAndFailSilent(watcher,groupBasePath,ProtobufMagic.PB_MAGIC);
    List<ZKUtil.ZKUtilOp> zkOps=new ArrayList<>(newGroupMap.size());
    for (    String groupName : prevRSGroups) {
      if (!newGroupMap.containsKey(groupName)) {
        String znode=ZNodePaths.joinZNode(groupBasePath,groupName);
        zkOps.add(ZKUtil.ZKUtilOp.deleteNodeFailSilent(znode));
      }
    }
    for (    RSGroupInfo RSGroupInfo : newGroupMap.values()) {
      String znode=ZNodePaths.joinZNode(groupBasePath,RSGroupInfo.getName());
      RSGroupProtos.RSGroupInfo proto=RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo);
      LOG.debug("String_Node_Str" + znode);
      ZKUtil.createAndFailSilent(watcher,znode);
      zkOps.add(ZKUtil.ZKUtilOp.deleteNodeFailSilent(znode));
      zkOps.add(ZKUtil.ZKUtilOp.createAndFailSilent(znode,ProtobufUtil.prependPBMagic(proto.toByteArray())));
    }
    LOG.debug("String_Node_Str" + zkOps.size());
    ZKUtil.multiOrSequential(watcher,zkOps,false);
  }
 catch (  KeeperException e) {
    LOG.error("String_Node_Str",e);
    masterServices.abort("String_Node_Str",e);
    throw new IOException("String_Node_Str",e);
  }
  updateCacheOfRSGroups(newGroupMap.keySet());
}

Fixed version (ground truth):
private synchronized void flushConfig(Map<String,RSGroupInfo> newGroupMap) throws IOException {
  Map<TableName,String> newTableMap;
  if (!isOnline()) {
    Map<String,RSGroupInfo> m=Maps.newHashMap(rsGroupMap);
    RSGroupInfo oldDefaultGroup=m.remove(RSGroupInfo.DEFAULT_GROUP);
    RSGroupInfo newDefaultGroup=newGroupMap.remove(RSGroupInfo.DEFAULT_GROUP);
    if (!m.equals(newGroupMap) || !oldDefaultGroup.getTables().equals(newDefaultGroup.getTables())) {
      throw new IOException("String_Node_Str");
    }
    newGroupMap.put(RSGroupInfo.DEFAULT_GROUP,newDefaultGroup);
    rsGroupMap=newGroupMap;
    return;
  }
  newTableMap=flushConfigTable(newGroupMap);
  resetRSGroupAndTableMaps(newGroupMap,newTableMap);
  try {
    String groupBasePath=ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode,rsGroupZNode);
    ZKUtil.createAndFailSilent(watcher,groupBasePath,ProtobufMagic.PB_MAGIC);
    List<ZKUtil.ZKUtilOp> zkOps=new ArrayList<>(newGroupMap.size());
    for (    String groupName : prevRSGroups) {
      if (!newGroupMap.containsKey(groupName)) {
        String znode=ZNodePaths.joinZNode(groupBasePath,groupName);
        zkOps.add(ZKUtil.ZKUtilOp.deleteNodeFailSilent(znode));
      }
    }
    for (    RSGroupInfo RSGroupInfo : newGroupMap.values()) {
      String znode=ZNodePaths.joinZNode(groupBasePath,RSGroupInfo.getName());
      RSGroupProtos.RSGroupInfo proto=RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo);
      LOG.debug("String_Node_Str" + znode);
      ZKUtil.createAndFailSilent(watcher,znode);
      zkOps.add(ZKUtil.ZKUtilOp.deleteNodeFailSilent(znode));
      zkOps.add(ZKUtil.ZKUtilOp.createAndFailSilent(znode,ProtobufUtil.prependPBMagic(proto.toByteArray())));
    }
    LOG.debug("String_Node_Str" + zkOps.size());
    ZKUtil.multiOrSequential(watcher,zkOps,false);
  }
 catch (  KeeperException e) {
    LOG.error("String_Node_Str",e);
    masterServices.abort("String_Node_Str",e);
    throw new IOException("String_Node_Str",e);
  }
  updateCacheOfRSGroups(newGroupMap.keySet());
}