@TestOnly
  public static String checkContextLock(SchemaPageContext cxt) {
    StringBuilder builder = new StringBuilder();

    for (ISchemaPage page : cxt.referredPages.values()) {
      builder.append(
          String.format(
              "page:%d, wl:%d, rl:%d, trace:%b, dirty:%b;\n",
              page.getPageIndex(),
              ((ReentrantReadWriteLock) page.getLock()).getWriteHoldCount(),
              ((ReentrantReadWriteLock) page.getLock()).getReadLockCount(),
              cxt.lockTraces.contains(page.getPageIndex()),
              page.isDirtyPage()));
    }
    return builder.toString();
  }
This method {@linkplain #reEstimateSegSize} is called when {@linkplain
SchemaPageOverflowException} occurs. It is designed to accelerate when there is lots of new
children nodes, avoiding segments extend several times.

<p>Notice that SegmentOverflowException inside a page with sufficient space will not reach
here. Supposed to merge with SchemaFile#reEstimateSegSize.

@param expSize expected size calculated from next new record
@param batchSize size of children within one #writeNewChildren(ICachedMNode)
@return estimated size
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/pagemgr/PageManager.java