@Override
  public ICachedMNode setToInternal(IDeviceMNode<ICachedMNode> entityMNode) {
    int rawSize = entityMNode.estimateSize();
    AtomicReference<Boolean> resultReference = new AtomicReference<>(false);
    // the entityMNode is just a wrapper, the actual CachedMNode instance shall be the same before
    // and after
    // setToInternal
    ICachedMNode internalMNode = entityMNode.getAsMNode();
    updateMNode(
        internalMNode, o -> resultReference.getAndSet(MNodeUtils.setToInternal(entityMNode)));

    boolean isSuccess = resultReference.get();
    if (isSuccess) {
      regionStatistics.deleteDevice();
      memoryStatistics.updatePinnedSize(internalMNode.estimateSize() - rawSize);
    }

    return internalMNode;
  }
The upside modification on node in MTree or MManager should be sync to MTreeStore explicitly.
Must pin the node first before update

@param node the modified node
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/CachedMTreeStore.java