You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "crossoverJie (via GitHub)" <gi...@apache.org> on 2024/11/21 06:02:01 UTC

[PR] [improve][broker] TopicStats specify serialized field name [pulsar]

crossoverJie opened a new pull request, #23621:
URL: https://github.com/apache/pulsar/pull/23621

   
   
   ### Motivation
   
   ![image](https://github.com/user-attachments/assets/70e21af3-7bc6-4117-988c-a7abde9cd2c3)
   TopicStats API contains duplicate fields.
   
   ### Modifications
   
   Use `@JsonProperty("isReplicated")` to specify serialization names.
   
   ### 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:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *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
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#discussion_r1851531766


##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/SubscriptionStatsImpl.java:
##########
@@ -115,9 +116,11 @@ public class SubscriptionStatsImpl implements SubscriptionStats {
     public List<ConsumerStatsImpl> consumers;
 
     /** Tells whether this subscription is durable or ephemeral (eg.: from a reader). */
+    @JsonProperty("isDurable")
     public boolean isDurable;
 
     /** Mark that the subscription state is kept in sync across different regions. */
+    @JsonProperty("isReplicated")
     public boolean isReplicated;

Review Comment:
   I think that the properties with `is` prefix shouldn't ever end up in the JSON output. We should address that problem instead and keep `durable` and `replicated` in the output instead of making them `isDurable` and `isReplicated`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "dao-jun (via GitHub)" <gi...@apache.org>.
dao-jun commented on code in PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#discussion_r1851611375


##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/SubscriptionStatsImpl.java:
##########
@@ -115,9 +116,11 @@ public class SubscriptionStatsImpl implements SubscriptionStats {
     public List<ConsumerStatsImpl> consumers;
 
     /** Tells whether this subscription is durable or ephemeral (eg.: from a reader). */
+    @JsonProperty("isDurable")
     public boolean isDurable;
 
     /** Mark that the subscription state is kept in sync across different regions. */
+    @JsonProperty("isReplicated")
     public boolean isReplicated;

Review Comment:
   +1 with lari



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#issuecomment-2490306388

   @crossoverJie Which Pulsar client and broker version did you experience this with?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#issuecomment-2553282286

   @lhotari please take a look


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on code in PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#discussion_r1853243309


##########
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/SubscriptionStatsImpl.java:
##########
@@ -115,9 +116,11 @@ public class SubscriptionStatsImpl implements SubscriptionStats {
     public List<ConsumerStatsImpl> consumers;
 
     /** Tells whether this subscription is durable or ephemeral (eg.: from a reader). */
+    @JsonProperty("isDurable")
     public boolean isDurable;
 
     /** Mark that the subscription state is kept in sync across different regions. */
+    @JsonProperty("isReplicated")
     public boolean isReplicated;

Review Comment:
   Thanks for the suggestion, I has been modified and it is a breaking change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#issuecomment-2553424407

   > [#23621 (comment)](https://github.com/apache/pulsar/pull/23621#discussion_r1851531766) . We don't want to introduce breaking changes or promote the fields starting with "is"? Is the duplicate field the only issue?
   
   Yes, just remove the `is` prefix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#issuecomment-2490385989

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/23621?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 74.37%. Comparing base [(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`ef6c257`)](https://app.codecov.io/gh/apache/pulsar/commit/ef6c25775672a441de7112bd0c716265504b5ff2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 739 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/23621/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/23621?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #23621      +/-   ##
   ============================================
   + Coverage     73.57%   74.37%   +0.79%     
   - Complexity    32624    34987    +2363     
   ============================================
     Files          1877     1944      +67     
     Lines        139502   147130    +7628     
     Branches      15299    16224     +925     
   ============================================
   + Hits         102638   109426    +6788     
   - Misses        28908    29271     +363     
   - Partials       7956     8433     +477     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/23621/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/23621/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.28% <ø> (+2.70%)` | :arrow_up: |
   | [systests](https://app.codecov.io/gh/apache/pulsar/pull/23621/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.37% <ø> (+0.05%)` | :arrow_up: |
   | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/23621/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.76% <ø> (+0.91%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/23621?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...mon/policies/data/stats/SubscriptionStatsImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/23621?src=pr&el=tree&filepath=pulsar-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fcommon%2Fpolicies%2Fdata%2Fstats%2FSubscriptionStatsImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbW1vbi9wb2xpY2llcy9kYXRhL3N0YXRzL1N1YnNjcmlwdGlvblN0YXRzSW1wbC5qYXZh) | `94.69% <ø> (+0.57%)` | :arrow_up: |
   
   ... and [658 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/23621/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>
   ----
   🚨 Try these New Features:
   
   - [Flaky Tests Detection](https://docs.codecov.com/docs/test-result-ingestion-beta) - Detect and resolve failed and flaky tests
   - [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis) - Avoid shipping oversized bundles


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on PR #23621:
URL: https://github.com/apache/pulsar/pull/23621#issuecomment-6348355455

   Thanks @crossoverJie, and sorry this sat for so long. I'm going through the open-PR backlog. The duplicate keys are harmless (both always have the same value). Dropping `isDurable` / `isReplicated` from the stats JSON, and the public fields from `SubscriptionStatsImpl`, would break existing scripts and tools that read them, which is what Lari raised. I'll close this for now. If we want to clean up the duplicates, it should be a deprecation that lands in a major release with a release note. Happy to review that if you're interested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][broker] TopicStats specify serialized field name [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat closed pull request #23621: [improve][broker] TopicStats specify serialized field name
URL: https://github.com/apache/pulsar/pull/23621


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org