@Override
  public IDeviceMNode<ICachedMNode> setToEntity(ICachedMNode node) {
    int rawSize = node.estimateSize();
    AtomicReference<Boolean> resultReference = new AtomicReference<>(false);
    updateMNode(node, o -> resultReference.getAndSet(MNodeUtils.setToEntity(node)));

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

    return node.getAsDeviceMNode();
  }
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