@Override
  public void deleteChild(ICachedMNode parent, String childName) throws MetadataException {
    lockManager.globalWriteLock();
    try {
      ICachedMNode deletedMNode = getChild(parent, childName, false, false);
      ICachedMNodeContainer container = ICachedMNodeContainer.getCachedMNodeContainer(parent);
      if (!container.isVolatile() && !container.hasChildInNewChildBuffer(childName)) {
        // the container has been persisted and this child is not a new child, which means the child
        // has been persisted and should be deleted from disk
        try {
          file.delete(deletedMNode);
        } catch (IOException e) {
          throw new MetadataException(e);
        }
      }

      parent.deleteChild(childName);
      memoryManager.remove(deletedMNode);
    } finally {
      lockManager.globalWriteUnlock();
    }
  }
This method will delete a node from MTree, which means the corresponding subTree will be
deleted. Before deletion, the measurementMNode in this subtree should be collected for updating
statistics in MManager. The deletion will delete subtree in PBTree first and then delete the
node from memory. The target node and its ancestors should be pinned before invoking this
problem.

@param parent the parent node of the target node
@param childName the name of the target node
@throws MetadataException
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/CachedMTreeStore.java