public void markDirty(ISchemaPage page, boolean forceReplace) {
    if (!page.isDirtyPage()) {
      dirtyCnt++;
    }
    page.setDirtyFlag();
    refer(page);
    if (forceReplace && referredPages.containsKey(page.getPageIndex())) {

      // previous page is dirty, so it's not a new dirty page
      if (referredPages.get(page.getPageIndex()).isDirtyPage()) {
        dirtyCnt--;
      }
      // force to replace
      referredPages.put(page.getPageIndex(), page);
    }
  }
Thread local variables about write/update process.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/pagemgr/SchemaPageContext.java