Skip to content

Conversation

@poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Sep 3, 2025

Motivation

Background

  • The oldest behaviour of offload settings: Pulsar only supports setting Broker-level offload policies and namespace-level thresholds. and handle namespace-level thresholds by the following fields:
    • {@link Policies#offload_deletion_lag_ms}
    • {@link Policies#offload_threshold}
    • {@link Policies#offload_threshold_in_seconds}
  • After Namespace level offloader #6183, Pulsar supports namespace-level policies, which were supported by {@link Policies#offload_policies}. And the thresholds were moved to the following fields:
    • {@link Policies#offload_policies} -> {@link OffloadPoliciesImpl#getManagedLedgerOffloadDeletionLagInMillis}
    • {@link Policies#offload_policies} -> {@link OffloadPoliciesImpl#getManagedLedgerOffloadThresholdInBytes}
    • {@link Policies#offload_policies} -> {@link OffloadPoliciesImpl#getManagedLedgerOffloadThresholdInSeconds}
  • [Issue 6283][tiered-storage] Offload policies per namespace #6422 made setting offload thresholds({@link Policies#offload_deletion_lag_ms}, {@link Policies#offload_threshold}, {@link Policies#offload_threshold_in_seconds}) affect namespace policies({@link Policies#offload_policies} )
  • But neither mechanisms work well together

The issue we encountered, Thanks @horizonzy for investigating the issue

> pulsar-admin topicPolicies get-offload-policies <topic>
null

> more conf/broker.conf | grep -i "managedLedgerOffload"
managedLedgerOffloadDeletionLagMs=63072000000
managedLedgerOffloadAutoTriggerSizeThresholdBytes=-1
managedLedgerOffloadThresholdInSeconds=-1

> pulsar-admin namespaces get-offload-threshold <namespace>
offloadThresholdInBytes: 0
offloadThresholdInSeconds: -1

> pulsar-admin topicPolicies get-offload-policies <topic> -ap
{
  ...
  "managedLedgerOffloadThresholdInSeconds" : -1,
  "managedLedgerOffloadThresholdInBytes" : -1,
}
  • How to reproduce the issue
    • create namespace-level offload policies
    • set namespace-level offload policies thresholds
    • remove namespace-level offload policies
    • get topic-level offload policies with -ap, you will get a dirty view

Modifications

To make the offload policies compatible with the old policies, use the old policies' threshold({@link Policies#offload_deletion_lag_ms}, {@link Policies#offload_threshold}, {@link Policies#offload_threshold_in_seconds}) if the new policies({@link Policies#offload_policies} ) are not set. Once the new fields are set, the old fields will be removed.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode added this to the 4.2.0 milestone Sep 3, 2025
@poorbarcode poorbarcode self-assigned this Sep 3, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 3, 2025
@Technoboy- Technoboy- closed this Sep 3, 2025
@Technoboy- Technoboy- reopened this Sep 3, 2025
@Technoboy- Technoboy- merged commit 96bc370 into apache:master Sep 4, 2025
122 of 127 checks passed
poorbarcode added a commit that referenced this pull request Sep 10, 2025
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 12, 2025
nborisov pushed a commit to nborisov/pulsar that referenced this pull request Sep 12, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants