private boolean writeCanNotFlushMarkerToWAL(WriteEntry flushOpSeqIdMVCCEntry, WAL wal,
    boolean writeFlushWalMarker) {
    FlushDescriptor desc = ProtobufUtil.toFlushDescriptor(FlushAction.CANNOT_FLUSH, getRegionInfo(),
      -1, new TreeMap<>(Bytes.BYTES_COMPARATOR));
    RegionReplicationSink sink = regionReplicationSink.orElse(null);

    if (sink != null && !writeFlushWalMarker) {
      /**
       * Here for replication to secondary region replica could use {@link FlushAction#CANNOT_FLUSH}
       * to recover when writeFlushWalMarker is false, we create {@link WALEdit} for
       * {@link FlushDescriptor} and attach the {@link RegionReplicationSink#add} to the
       * flushOpSeqIdMVCCEntry,see HBASE-26960 for more details.
       */
      this.attachRegionReplicationToFlushOpSeqIdMVCCEntry(flushOpSeqIdMVCCEntry, desc, sink);
      return false;
    }

    if (writeFlushWalMarker && wal != null && !writestate.readOnly) {
      try {
        WALUtil.writeFlushMarker(wal, this.getReplicationScope(), getRegionInfo(), desc, true, mvcc,
          sink);
        return true;
      } catch (IOException e) {
        LOG.warn(getRegionInfo().getEncodedName() + " : "
          + "Received exception while trying to write the flush request to wal", e);
      }
    }
    return false;
  }
This method is only used when we flush but the memstore is empty,if writeFlushWalMarker is
true,we write the {@link FlushAction#CANNOT_FLUSH} flush marker to WAL when the memstore is
empty. Ignores exceptions from WAL. Returns whether the write succeeded.
@return whether WAL write was successful
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java