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] Should not throw NotFoundException when metadata already exists. #20539

Merged
merged 1 commit into from
Jun 9, 2023
Merged

[fix][broker] Should not throw NotFoundException when metadata already exists. #20539

merged 1 commit into from
Jun 9, 2023

Conversation

liangyepianzhou
Copy link
Contributor

@liangyepianzhou liangyepianzhou commented Jun 8, 2023

Motivation

Make the Exception more clear.

Modification

Return the 409 Conflict instead of 404 NoFound when metadata already exists.

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:

…y exists.

## Motivation
Make the Exception more clear.
## Modification
Return the `404 NoFound` to `409 Conflict` when metadata already exists.
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 8, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #20539 (d0291ae) into master (d7186a6) will increase coverage by 0.02%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #20539      +/-   ##
============================================
+ Coverage     72.93%   72.96%   +0.02%     
- Complexity    31930    31952      +22     
============================================
  Files          1867     1867              
  Lines        138555   138562       +7     
  Branches      15218    15220       +2     
============================================
+ Hits         101059   101100      +41     
+ Misses        29466    29447      -19     
+ Partials       8030     8015      -15     
Flag Coverage Δ
inttests 24.20% <41.66%> (-0.04%) ⬇️
systests 24.97% <41.66%> (+0.07%) ⬆️
unittests 72.26% <75.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...rg/apache/pulsar/broker/service/BrokerService.java 81.05% <ø> (+0.50%) ⬆️
.../pulsar/broker/service/persistent/SystemTopic.java 80.00% <0.00%> (-12.31%) ⬇️
.../apache/pulsar/broker/admin/impl/PackagesBase.java 76.63% <50.00%> (+0.44%) ⬆️
...rg/apache/pulsar/broker/service/AbstractTopic.java 88.20% <100.00%> (+0.19%) ⬆️
...ache/pulsar/broker/service/EntryFilterSupport.java 97.36% <100.00%> (+0.07%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 79.66% <100.00%> (+0.26%) ⬆️
...s/management/core/impl/PackagesManagementImpl.java 77.85% <100.00%> (+4.28%) ⬆️

... and 70 files with indirect coverage changes

@Technoboy- Technoboy- added this to the 3.1.0 milestone Jun 8, 2023
@liangyepianzhou liangyepianzhou merged commit aa1d5d9 into apache:master Jun 9, 2023
@liangyepianzhou liangyepianzhou deleted the file_alreadyExist branch June 9, 2023 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants