Skip to content

[Broker] Remove check resource when delete failure domain - #13421

Merged
codelipenghui merged 2 commits into
apache:masterfrom
nodece:remove_check_path
Dec 28, 2021
Merged

[Broker] Remove check resource when delete failure domain#13421
codelipenghui merged 2 commits into
apache:masterfrom
nodece:remove_check_path

Conversation

@nodece

@nodece nodece commented Dec 21, 2021

Copy link
Copy Markdown
Member

Motivation

This PR is used to keep same behavior with Pulsar 2.8 and 2.7 version.

In Pulsar 2.7 and 2.8, when delete a non-existent failure domain resource, it will return 404 status code.
In Pulsar 2.9, when delete a non-existent failure domain resource, it will return 200 status code.

Reproduce in Pulsar 2.8:

$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.8.1 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
[✖]  code: 404 reason: Domain-name non-existent-failure-domain or cluster standalone does not exist

Reproduce in Pulsar 2.9:

$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.9.0 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
Delete failure domain [non-existent-failure-domain] for cluster [standalone] succeed

Affected version: 2.9.x

This issue was caused by #11693.

Modifications

  • Remove check resource exists when call the ClusterResources#deleteFailureDomain()
  • Add check resource exists when call the ClusterResources#deleteFailureDomains()

Documentation

Need to update docs?

  • no-need-doc

Signed-off-by: Zixuan Liu nodeces@gmail.com

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Dec 21, 2021
### Motivation

This PR is used to keep same behavior with Pulsar 2.8 and 2.7 version.

In Pulsar 2,7 and 2.8, when delete a non-existent failure domain resource, it will return 404 status code.
In Pulsar 2.9, when delete a non-existent failure domain resource, it will return 200 status code.

Reproduce in Pulsar 2.8:
```
$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.8.1 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
[✖]  code: 404 reason: Domain-name non-existent-failure-domain or cluster standalone does not exist
```

Reproduce in Pulsar 2.9:
```
$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.9.0 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
Delete failure domain [non-existent-failure-domain] for cluster [standalone] succeed
```

Affected version: 2.9.x

### Modifications

- Remove check resource exists when call the delete failure domain API

### Documentation

Need to update docs?

- [x] `no-need-doc`

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@nodece nodece changed the title [Broker] Remove check path when delete failure domain [Broker] Remove check resource when delete failure domain Dec 21, 2021
@nodece

nodece commented Dec 21, 2021

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@codelipenghui

Copy link
Copy Markdown
Contributor

@nodece Do you know which change introduced the breaking change?

@nodece

nodece commented Dec 21, 2021

Copy link
Copy Markdown
Member Author

@codelipenghui This issue was caused by #11693.

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

@nodece Could you please help a test to avoid regression?

@nodece

nodece commented Dec 23, 2021

Copy link
Copy Markdown
Member Author

@codelipenghui Added test.

@nodece

nodece commented Dec 23, 2021

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@nodece
nodece requested a review from codelipenghui December 23, 2021 15:46
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@codelipenghui
codelipenghui merged commit 7f4aac5 into apache:master Dec 28, 2021
codelipenghui pushed a commit that referenced this pull request Dec 30, 2021
### Motivation

This PR is used to keep same behavior with Pulsar 2.8 and 2.7 version.

In Pulsar 2.7 and 2.8, when delete a non-existent failure domain resource, it will return 404 status code.
In Pulsar 2.9, when delete a non-existent failure domain resource, it will return 200 status code.

Reproduce in Pulsar 2.8:
```
$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.8.1 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
[✖]  code: 404 reason: Domain-name non-existent-failure-domain or cluster standalone does not exist
```

Reproduce in Pulsar 2.9:
```
$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.9.0 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
Delete failure domain [non-existent-failure-domain] for cluster [standalone] succeed
```

Affected version: 2.9.x

This issue was caused by #11693.

### Modifications

- Remove check resource exists when call the `ClusterResources#deleteFailureDomain()`
- Add check resource exists when call the  `ClusterResources#deleteFailureDomains()`

(cherry picked from commit 7f4aac5)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 30, 2021
wuzhanpeng pushed a commit to wuzhanpeng/pulsar that referenced this pull request Jan 5, 2022
### Motivation

This PR is used to keep same behavior with Pulsar 2.8 and 2.7 version.

In Pulsar 2.7 and 2.8, when delete a non-existent failure domain resource, it will return 404 status code.
In Pulsar 2.9, when delete a non-existent failure domain resource, it will return 200 status code.

Reproduce in Pulsar 2.8:
```
$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.8.1 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
[✖]  code: 404 reason: Domain-name non-existent-failure-domain or cluster standalone does not exist
```

Reproduce in Pulsar 2.9:
```
$ docker run -itd \
  -p 6650:6650 \
  -p 8080:8080 \
  apachepulsar/pulsar:2.9.0 \
  bin/pulsar standalone
$ pulsarctl clusters delete-failure-domain standalone non-existent-failure-domain
Delete failure domain [non-existent-failure-domain] for cluster [standalone] succeed
```
                   
Affected version: 2.9.x

This issue was caused by apache#11693.

### Modifications

- Remove check resource exists when call the `ClusterResources#deleteFailureDomain()`
- Add check resource exists when call the  `ClusterResources#deleteFailureDomains()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.9.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants