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] Fix deleting topic not delete the related topic policy and schema. #21093

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

Technoboy-
Copy link
Contributor

@Technoboy- Technoboy- commented Aug 30, 2023

Fixes #21075

Motivation

When the topic is loaded, it will delete the topic-level policy if it is enabled. But if the topic is not loaded, it will directly delete through managed ledger factory. But then we will leave the topic policy there. When the topic is created next time, it will use the old topic policy

Modifications

When deleting the topic, delete the schema and topic policies even if the topic is not loaded.

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

@Technoboy- Technoboy- added this to the 3.2.0 milestone Aug 30, 2023
@Technoboy- Technoboy- self-assigned this Aug 30, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 30, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #21093 (d23edc0) into master (6ff83b6) will increase coverage by 39.60%.
Report is 13 commits behind head on master.
The diff coverage is 96.66%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #21093       +/-   ##
=============================================
+ Coverage     33.52%   73.13%   +39.60%     
- Complexity    12221    32394    +20173     
=============================================
  Files          1623     1887      +264     
  Lines        127275   139911    +12636     
  Branches      13897    15395     +1498     
=============================================
+ Hits          42671   102320    +59649     
+ Misses        78986    29496    -49490     
- Partials       5618     8095     +2477     
Flag Coverage Δ
inttests 24.12% <23.33%> (+0.01%) ⬆️
systests 24.99% <33.33%> (?)
unittests 72.42% <96.66%> (+40.38%) ⬆️

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

Files Changed Coverage Δ
...va/org/apache/pulsar/client/impl/ConsumerImpl.java 76.91% <83.33%> (+22.15%) ⬆️
...rg/apache/pulsar/broker/service/AbstractTopic.java 86.75% <100.00%> (+27.96%) ⬆️
...rg/apache/pulsar/broker/service/BrokerService.java 81.19% <100.00%> (+25.60%) ⬆️

... and 1531 files with indirect coverage changes

@RobertIndie RobertIndie merged commit a1405ea into apache:master Sep 1, 2023
45 checks passed
Technoboy- added a commit that referenced this pull request Sep 5, 2023
…and schema. (#21093)

Fixes #21075 

### Motivation

When the topic is loaded, it will delete the topic-level policy if it is enabled. But if the topic is not loaded, it will directly delete through managed ledger factory. But then we will leave the topic policy there. When the topic is created next time, it will use the old topic policy

### Modifications

When deleting the topic, delete the schema and topic policies even if the topic is not loaded.
Technoboy- added a commit that referenced this pull request Sep 5, 2023
…and schema. (#21093)

Fixes #21075 

### Motivation

When the topic is loaded, it will delete the topic-level policy if it is enabled. But if the topic is not loaded, it will directly delete through managed ledger factory. But then we will leave the topic policy there. When the topic is created next time, it will use the old topic policy

### Modifications

When deleting the topic, delete the schema and topic policies even if the topic is not loaded.
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] Delete topic should delete the related topic policy
4 participants