code: static void writeLastTxidToZookeeper(long lastTxid, long totalBlocks,
        long totalInodes, long ssid, Configuration startupConf,
        Configuration confg) throws IOException {
      AvatarZooKeeperClient zk = null;
      LOG.info("Writing lastTxId: " + lastTxid + ", total blocks: " + totalBlocks
          + ", total inodes: " + totalInodes);
      if (lastTxid < 0) {
        LOG.warn("Invalid last transaction id : " + lastTxid
            + " skipping write to zookeeper.");
        return;
      }
      ZookeeperTxId zkTxid = new ZookeeperTxId(ssid, lastTxid, totalBlocks,
          totalInodes);
      int maxTries = startupConf.getInt("dfs.avatarnode.zk.retries", 3);
      for (int i = 0; i < maxTries; i++) {
        try {
          zk = new AvatarZooKeeperClient(confg, null, false);
          zk.registerLastTxId(startupConf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY), zkTxid);
          return;
        } catch (Exception e) {
          LOG.error("Got Exception when syncing last txid to zk. Will retry...",
              e);
        } finally {
          shutdownZkClient(zk);
        }
      }
      throw new IOException("Cannot connect to zk");
    }
docs: Writes the last transaction id of the primary avatarnode to zookeeper.