@SuppressWarnings("NPathComplexity")
    public boolean append0(AppendContext context, WalWriteRequest request, boolean fromBackoff) {
        // TODO: storage status check, fast fail the request when storage closed.
        if (!fromBackoff && !backoffRecords.isEmpty()) {
            backoffRecords.offer(request);
            return true;
        }
        if (!tryAcquirePermit()) {
            if (!fromBackoff) {
                backoffRecords.offer(request);
            }
            StorageOperationStats.getInstance().appendLogCacheFullStats.record(0L);
            if (System.currentTimeMillis() - lastLogTimestamp > 1000L) {
                LOGGER.warn("[BACKOFF] log cache size {} is larger than {}", deltaWALCache.size(), maxDeltaWALCacheSize);
                lastLogTimestamp = System.currentTimeMillis();
            }
            return true;
        }
        AppendResult appendResult;
        try {
            try {
                StreamRecordBatch streamRecord = request.record;
                streamRecord.retain();
                Lock lock = confirmOffsetCalculator.addLock();
                lock.lock();
                try {
                    appendResult = deltaWAL.append(new TraceContext(context), streamRecord.encoded());
                } finally {
                    lock.unlock();
                }
            } catch (OverCapacityException e) {
                // the WAL write data align with block, 'WAL is full but LogCacheBlock is not full' may happen.
                confirmOffsetCalculator.update();
                maybeForceUpload();
                if (!fromBackoff) {
                    backoffRecords.offer(request);
                }
                if (System.currentTimeMillis() - lastLogTimestamp > 1000L) {
                    LOGGER.warn("[BACKOFF] log over capacity", e);
                    lastLogTimestamp = System.currentTimeMillis();
                }
                return true;
            }
            long recordOffset = appendResult.recordOffset();
            if (recordOffset >= 0) {
                request.offset = recordOffset;
                confirmOffsetCalculator.add(request);
            }
        } catch (Throwable e) {
            LOGGER.error("[UNEXPECTED] append WAL fail", e);
            request.cf.completeExceptionally(e);
            return false;
        }
        appendResult.future().whenComplete((nil, ex) -> {
            if (ex != null) {
                LOGGER.error("append WAL fail, request {}", request, ex);
                storageFailureHandler.handle(ex);
                return;
            }
            handleAppendCallback(request);
        });
        return false;
    }
Append record to WAL.

@return backoff status.
s3stream/src/main/java/com/automq/stream/s3/S3Storage.java