Skip to content

[fix] [broker] fix replicated namespaces filter in filterAndUnloadMatchedNamespaceAsync - #23100

Merged
lhotari merged 15 commits into
apache:masterfrom
iosdev747:fixNSClustersInPolicies
Jul 31, 2024
Merged

[fix] [broker] fix replicated namespaces filter in filterAndUnloadMatchedNamespaceAsync#23100
lhotari merged 15 commits into
apache:masterfrom
iosdev747:fixNSClustersInPolicies

Conversation

@iosdev747

@iosdev747 iosdev747 commented Jul 30, 2024

Copy link
Copy Markdown
Contributor

Main Issue: #23092

Motivation

Problem is namespace unload operation happens on all the namespaces that matches the policy regex. Check should be done only on namespaces in current cluster.

Modifications

Fix namespace filter so only namespaces in current cluster should be used for unload operation.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Multi cluster setup where namespace is not present in one cluster but is there in other.

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: iosdev747#2

Comment thread pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java Outdated

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. The concurrency limiting solution will be needed to prevent issues for clusters with a lot of tenants and namespaces.

@lhotari

lhotari commented Jul 30, 2024

Copy link
Copy Markdown
Member

A test case would be needed. optimally a test that reproduces the original issue so that we can see that the changes fix it.

@lhotari

lhotari commented Jul 30, 2024

Copy link
Copy Markdown
Member

thanks for the contribution @iosdev747 , great work!

@codecov-commenter

codecov-commenter commented Jul 30, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.44444% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.45%. Comparing base (bbc6224) to head (13bf97a).
Report is 541 commits behind head on master.

Files Patch % Lines
.../apache/pulsar/broker/admin/impl/ClustersBase.java 94.44% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23100      +/-   ##
============================================
- Coverage     73.57%   73.45%   -0.13%     
- Complexity    32624    33540     +916     
============================================
  Files          1877     1919      +42     
  Lines        139502   144107    +4605     
  Branches      15299    15747     +448     
============================================
+ Hits         102638   105851    +3213     
- Misses        28908    30152    +1244     
- Partials       7956     8104     +148     
Flag Coverage Δ
inttests 27.59% <0.00%> (+3.00%) ⬆️
systests 24.74% <0.00%> (+0.41%) ⬆️
unittests 72.53% <94.44%> (-0.32%) ⬇️

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

Files Coverage Δ
.../apache/pulsar/broker/admin/impl/ClustersBase.java 80.96% <94.44%> (+0.46%) ⬆️

... and 516 files with indirect coverage changes

@lhotari lhotari added this to the 3.4.0 milestone Jul 30, 2024
@lhotari
lhotari merged commit 5aa5e7d into apache:master Jul 31, 2024
Technoboy- pushed a commit that referenced this pull request Aug 1, 2024
…chedNamespaceAsync (#23100)

Co-authored-by: Lari Hotari <lhotari@apache.org>
lhotari added a commit that referenced this pull request Aug 6, 2024
…chedNamespaceAsync (#23100)

Co-authored-by: Lari Hotari <lhotari@apache.org>
(cherry picked from commit 5aa5e7d)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 8, 2024
…chedNamespaceAsync (apache#23100)

Co-authored-by: Lari Hotari <lhotari@apache.org>
(cherry picked from commit 6c01bb0)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 12, 2024
…chedNamespaceAsync (apache#23100)

Co-authored-by: Lari Hotari <lhotari@apache.org>
(cherry picked from commit 6c01bb0)
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
…chedNamespaceAsync (apache#23100)

Co-authored-by: Lari Hotari <lhotari@apache.org>
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