apache/pulsar · error · IllegalArgumentException

ManagedLedgerOffloadMaxBlockSizeInBytes cannot be less than

Error message

ManagedLedgerOffloadMaxBlockSizeInBytes cannot be less than 5MB for ${driver} offload

What it means

Shared tiered-storage config validation (the VALIDATION lambda used by AWS/GCS/Azure drivers): managedLedgerOffloadMaxBlockSizeInBytes is below the 5MB minimum the drivers impose (S3 multipart limits), so block size validation aborts; the max-block-size configuration value is the faulty input.

Source

Thrown at tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java:300

    public ProviderMetadata getProviderMetadata() {
        return providerMetadata;
    }

    // Constants for reuse across AWS, GCS, and Azure, etc.
    static final ConfigValidation VALIDATION = (TieredStorageConfiguration config) -> {
        if (Strings.isNullOrEmpty(config.getRegion()) && Strings.isNullOrEmpty(config.getServiceEndpoint())) {
            throw new IllegalArgumentException(
                "Either Region or ServiceEndpoint must specified for " + config.getDriver() + " offload");
        }

        if (Strings.isNullOrEmpty(config.getBucket())) {
            throw new IllegalArgumentException(
                "Bucket cannot be empty for " + config.getDriver() + " offload");
        }

        if (config.getMaxBlockSizeInBytes() < (5 * 1024 * 1024)) {
            throw new IllegalArgumentException(
                "ManagedLedgerOffloadMaxBlockSizeInBytes cannot be less than 5MB for "
                + config.getDriver() + " offload");
        }
    };

    static final BlobStoreBuilder BLOB_STORE_BUILDER = (TieredStorageConfiguration config) -> {
        ContextBuilder contextBuilder = ContextBuilder.newBuilder(config.getProviderMetadata());
        ShadedJCloudsUtils.addStandardModules(contextBuilder);
        contextBuilder.overrides(config.getOverrides());

        if (StringUtils.isNotEmpty(config.getServiceEndpoint())) {
            contextBuilder.endpoint(config.getServiceEndpoint());
        }

        if (config.getProviderCredentials() != null) {
                return contextBuilder
                        .credentialsSupplier(config.getCredentials()::get)
                        .buildView(BlobStoreContext.class)

View on GitHub (pinned to 820761864e)

Solutions

  1. Raise managedLedgerOffloadMaxBlockSizeInBytes to at least 5MB
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java:300 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/31c8bc87de777e80. Report an issue: GitHub.