Skip to content

[fix][broker] Return non-null persistence policy for namespace - #14158

Closed
rdhabalia wants to merge 4 commits into
apache:masterfrom
rdhabalia:persistence_admin
Closed

[fix][broker] Return non-null persistence policy for namespace#14158
rdhabalia wants to merge 4 commits into
apache:masterfrom
rdhabalia:persistence_admin

Conversation

@rdhabalia

@rdhabalia rdhabalia commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

Motivation

Right now, if namespace is not configured with persistence policy then broker considers default persistence-policy while serving the topic but it returns null value in get-persistence admin API

./pulsar-admin namespaces get-persistence pulsar/standalone/ns2
null

Modification

Return default persistence policy if namespace persistence policy is not configured.

  • doc-not-needed

@github-actions

github-actions Bot commented Feb 8, 2022

Copy link
Copy Markdown

@rdhabalia:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

1 similar comment
@github-actions

github-actions Bot commented Feb 8, 2022

Copy link
Copy Markdown

@rdhabalia:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

eolivelli
eolivelli previously approved these changes Feb 8, 2022

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm

With this change, is it possible to know from the API if we set a policy vs we are returning the default values?

@rdhabalia

Copy link
Copy Markdown
Contributor Author

this change only impacts api-get call code-path and it will not change set-policy with default values.

@Jason918 Jason918 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can add an applied to control whether we should return namespace setting or the value that actually take effects, like many other polices in org.apache.pulsar.broker.admin.v2.PersistentTopics

@codelipenghui

Copy link
Copy Markdown
Contributor

I think we can add an applied to control whether we should return namespace setting or the value that actually take effects, like many other polices in org.apache.pulsar.broker.admin.v2.PersistentTopics

Agree, with this change, users will not able to know what is the namespace settings. We should apply the same behavior, for policies, if the topic/namespace don't have a policy, just provide a response to tell users no policy for this topic/namespace, if users want to check which policy will be applied, they can add --applied`.

@codelipenghui

Copy link
Copy Markdown
Contributor

I will move this one to milestone 2.11 first.

@codelipenghui codelipenghui modified the milestones: 2.10.0, 2.11.0 Feb 8, 2022
@rdhabalia

Copy link
Copy Markdown
Contributor Author

with this change, users will not able to know what is the namespace settings.

this is incorrect, this PR only sets default persistence policy if the value is not configured and right now it's returning null which is confusing for user. we don't need any additional control flag to show null value to user. and regrading other policies , that can be handled in separate PR and we don't want to mix everything in this one.

@codelipenghui this PR has minor change which doesn't break any change then why should we change the release for this PR and why can't we merge to 2.10 ?

@michaeljmarshall

Copy link
Copy Markdown
Member

On a note completely unrelated to the content of this PR, we're able to merge this PR without a test passing because it is not "required". I am working on fixing this by updating the .asf.yaml.

Screen Shot 2022-02-10 at 5 25 10 PM

@github-actions

Copy link
Copy Markdown

The pr had no activity for 30 days, mark with Stale label.

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@eolivelli eolivelli closed this Mar 19, 2022
@eolivelli eolivelli reopened this Mar 19, 2022
@eolivelli

Copy link
Copy Markdown
Contributor

Reopened to trigger CI

@github-actions

Copy link
Copy Markdown

The pr had no activity for 30 days, mark with Stale label.

@github-actions

Copy link
Copy Markdown

The pr had no activity for 30 days, mark with Stale label.

@codelipenghui codelipenghui modified the milestones: 2.11.0, 2.12.0 Jul 26, 2022
@tisonkun tisonkun changed the title [pulsar-broker] Fix: return non-null persistence policy for namespace [fix][broker] Return non-null persistence policy for namespace Dec 10, 2022
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Dec 10, 2022

@tisonkun tisonkun 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.

Rebased. Pending to merge.

@codecov-commenter

codecov-commenter commented Dec 10, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.84%. Comparing base (1b5722d) to head (a1bfb93).
⚠️ Report is 3154 commits behind head on master.

Files with missing lines Patch % Lines
.../org/apache/pulsar/broker/admin/AdminResource.java 0.00% 5 Missing ⚠️
...pache/pulsar/broker/admin/impl/NamespacesBase.java 0.00% 3 Missing ⚠️
...pulsar/broker/admin/impl/PersistentTopicsBase.java 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (1b5722d) and HEAD (a1bfb93). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1b5722d) HEAD (a1bfb93)
unittests 8 7
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #14158       +/-   ##
=============================================
- Coverage     46.34%   34.84%   -11.51%     
+ Complexity    10394     7480     -2914     
=============================================
  Files           703      703               
  Lines         68838    68840        +2     
  Branches       7379     7378        -1     
=============================================
- Hits          31905    23988     -7917     
- Misses        33324    41645     +8321     
+ Partials       3609     3207      -402     
Flag Coverage Δ
unittests 34.84% <0.00%> (-11.51%) ⬇️

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

Files with missing lines Coverage Δ
...pulsar/broker/admin/impl/PersistentTopicsBase.java 12.34% <0.00%> (-46.71%) ⬇️
...pache/pulsar/broker/admin/impl/NamespacesBase.java 15.18% <0.00%> (-47.92%) ⬇️
.../org/apache/pulsar/broker/admin/AdminResource.java 32.34% <0.00%> (-32.64%) ⬇️

... and 133 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tisonkun

Copy link
Copy Markdown
Member

It seems the codebase evolves a lot and the added test testSetPersistencePolicies#L439 fail now.

Close as stale.

@rdhabalia you may pick up this patch and rebase on the current master to pass the related tests and resubmit it again.

@tisonkun tisonkun closed this Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants