public synchronized void cancelFlush() {
        // Verify we're still flushing data to handle a race between cancelFlush() calls from up the
        // call stack and callbacks from the write request to underlying storage
        if (flushing()) {
            // Just recombine the data and place it back in the primary storage
            toFlush.putAll(data);
            data = toFlush;
            currentFlushId++;
            flushInProgress.release();
            toFlush = null;
        }
    }
Cancel a flush that has been initiated by {@link #beginFlush}. This should not be called if
{@link #doFlush} has already been invoked. It should be used if an operation performed
between beginFlush and doFlush failed.
connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetStorageWriter.java