GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug] Applying Pulsar Topic Policies fails when multiple policies are updated in a short period of time · Issue #24393 · apache/pulsar

[Bug] Applying Pulsar Topic Policies fails when multiple policies are updated in a short period of time #24393

New issue
Copy link
New issue
Copy link
Closed
#24427
Closed
[Bug] Applying Pulsar Topic Policies fails when multiple policies are updated in a short period of time#24393
#24427
Copy link
Labels
type/bugThe PR fixed a bug or issue reported a bug

Description

@shasank112001
shasank112001
opened on Jun 6, 2025
Issue body actions

Search before reporting

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

User environment

Pulsar Version = 4.0.3
OS = Linux
Java Version = 21
Client Library Version = 4.0.3 (Pulsar-Admin)
Client OS = Darwin (Mac)
Client Java Version = 21

Issue Description

I have a function to create topics and apply policies on that topic.

admin.topicPolicies().setInactiveTopicPolicies(pulsarTopic, policies.inactive_topic_policies);

admin.topics().setReplicationClusters(pulsarTopic, List.of("cluster-a", "cluster-b"));

admin.topicPolicies().setSubscriptionTypesEnabledAsync(pulsarTopic, Set.of(SubscriptionType.Shared));

admin.topics().updateProperties(pulsarTopic, policies.properties);

However, after applying these, when I verify the results I get mismatching results:

  1. replication clusters is null (if I do with "applied"=true, I only get 1 cluster name)
  2. subscriptionTypesEnabled = [].

If I introduce a 1 second delay between each of the commands using Thread.sleep(1000), then I don't get these errors.

Also the following order of commands works as well :

admin.topics().setReplicationClusters(pulsarTopic, List.of("cluster-a", "cluster-b"));

admin.topicPolicies().setInactiveTopicPolicies(pulsarTopic, policies.inactive_topic_policies);

admin.topics().updateProperties(pulsarTopic, policies.properties);

admin.topicPolicies().setSubscriptionTypesEnabledAsync(pulsarTopic, Set.of(SubscriptionType.Shared));

I believe this might be a result of Async policy application on the broker.

Error messages

No error messages are observed. Each  POST call succeeds with a 204.

Reproducing the issue

You can run the two method call orderings and verify the results.

Additional information

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. shasank112001
    added
    type/bugThe PR fixed a bug or issue reported a bug
    on Jun 6, 2025
  2. lhotari commented on Jun 6, 2025

    @lhotari
    lhotari
    on Jun 6, 2025
    Member
    More actions

    Possibly related to #21303.

  3. shasank112001 commented on Jun 6, 2025

    @shasank112001
    shasank112001
    on Jun 6, 2025
    ContributorAuthor
    More actions

    Seems to be related, must have missed that issue during my search. Any plans on fixing this? I was also wondering, why topic policies are not updated in a similar fashion to namespaces. It seems all policies on topics are almost the same as namespaces, If we were to consolidate the update into one call, the changes could be better managed. What do you think?

  4. lhotari commented on Jun 6, 2025

    @lhotari
    lhotari
    on Jun 6, 2025
    Member
    More actions

    Seems to be related, must have missed that issue during my search. Any plans on fixing this? I was also wondering, why topic policies are not updated in a similar fashion to namespaces. It seems all policies on topics are almost the same as namespaces, If we were to consolidate the update into one call, the changes could be better managed. What do you think?

    I hope this gets more attention and gets fixed soon. Topic policies aren't stored in the Metadata store and perhaps that's one of the reasons why exactly the same solution as there was for namespaces cannot be directly applied to topic policies.

  5. lhotari commented on Jun 18, 2025

    @lhotari
    lhotari
    on Jun 18, 2025
    Member
    More actions

    WIP fix in #24427

  6. lhotari
    closed this as completedin #24427on Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.