Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][broker][admin] Fix cannot update properties on NonDurable subscription. #22411

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

dao-jun
Copy link
Member

@dao-jun dao-jun commented Apr 3, 2024

Fixes #22402

Motivation

Fix cannot update properties on NonDurable subscription.

Reproduce step:

  1. Create NonDurable subscription on a topic, and update subscription properties:
        PulsarClient client = PulsarClient.builder()
                .serviceUrl("pulsar://localhost:6650")
                .build();

        Producer<String> producer = client.newProducer(Schema.STRING)
                .enableBatching(false)
                .topic("persistent://public/default/test")
                .create();

        producer.send("Hello, Pulsar!");

        Reader<String> consumer = client.newReader(Schema.STRING).subscriptionName("sub").topic("persistent://public/default/test").startMessageId(MessageId.earliest).create();

        PulsarAdmin admin = PulsarAdmin.builder().serviceHttpUrl("http://localhost:8080").build();

        Map<String, String> properties = new HashMap<>();
        properties.put("foo", "bar");

        admin.topics().updateSubscriptionProperties("persistent://public/default/test", "sub", properties);

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

@dao-jun dao-jun self-assigned this Apr 3, 2024
@dao-jun dao-jun added type/bug The PR fixed a bug or issue reported a bug area/ML labels Apr 3, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Apr 3, 2024
@dao-jun dao-jun added this to the 3.3.0 milestone Apr 3, 2024
@dao-jun dao-jun closed this Apr 3, 2024
@dao-jun dao-jun reopened this Apr 3, 2024
@dao-jun
Copy link
Member Author

dao-jun commented Apr 4, 2024

@lhotari @codelipenghui @mattisonchao @eolivelli @Technoboy- Could you please take a look?

dao-jun added 3 commits April 4, 2024 16:36
# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
@dao-jun dao-jun requested a review from lhotari April 4, 2024 15:38
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.81%. Comparing base (bbc6224) to head (9d48862).
Report is 122 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22411      +/-   ##
============================================
+ Coverage     73.57%   73.81%   +0.23%     
+ Complexity    32624    32402     -222     
============================================
  Files          1877     1885       +8     
  Lines        139502   139818     +316     
  Branches      15299    15319      +20     
============================================
+ Hits         102638   103203     +565     
+ Misses        28908    28636     -272     
- Partials       7956     7979      +23     
Flag Coverage Δ
inttests 26.98% <20.00%> (+2.39%) ⬆️
systests 24.67% <0.00%> (+0.34%) ⬆️
unittests 73.07% <100.00%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 79.06% <100.00%> (-0.24%) ⬇️

... and 186 files with indirect coverage changes

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lhotari lhotari merged commit 902728e into apache:master Apr 5, 2024
50 checks passed
@dao-jun dao-jun deleted the fix/update_props_nondurable_sub branch April 5, 2024 07:47
lhotari pushed a commit that referenced this pull request Apr 5, 2024
…ription. (#22411)

(cherry picked from commit 902728e)

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
lhotari pushed a commit that referenced this pull request Apr 5, 2024
…ription. (#22411)

(cherry picked from commit 902728e)

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
lhotari pushed a commit that referenced this pull request Apr 5, 2024
…ription. (#22411)

(cherry picked from commit 902728e)

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 5, 2024
…ription. (apache#22411)

(cherry picked from commit 902728e)

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
(cherry picked from commit 7cd0924)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 8, 2024
…ription. (apache#22411)

(cherry picked from commit 902728e)

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
(cherry picked from commit 7cd0924)
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 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.

[Bug] Unable to update subscription properties on non-durable subscription
3 participants