Fix trigger GC not work#3998
Merged
Merged
Conversation
zymap
reviewed
Jun 22, 2023
| Boolean forceMajor = (Boolean) configMap.getOrDefault("forceMajor", null); | ||
| Boolean forceMinor = (Boolean) configMap.getOrDefault("forceMinor", null); | ||
| bookieServer.getBookie().getLedgerStorage().forceGC(forceMajor, forceMinor); | ||
| response.setCode(HttpServer.StatusCode.NOT_FOUND); |
Member
There was a problem hiding this comment.
The status should be NOT_ALLOWED, see here https://httpwg.org/specs/rfc9110.html#status.405
Contributor
Author
There was a problem hiding this comment.
Updated. It will change the current status code.
eolivelli
approved these changes
Jun 22, 2023
| Boolean forceMajor = (Boolean) configMap.getOrDefault("forceMajor", null); | ||
| Boolean forceMinor = (Boolean) configMap.getOrDefault("forceMinor", null); | ||
| bookieServer.getBookie().getLedgerStorage().forceGC(forceMajor, forceMinor); | ||
| response.setCode(HttpServer.StatusCode.NOT_FOUND); |
zymap
approved these changes
Jun 25, 2023
zymap
pushed a commit
that referenced
this pull request
Jun 26, 2023
* Fix trigger gc not work (cherry picked from commit 147b5bf)
zymap
pushed a commit
that referenced
this pull request
Dec 7, 2023
* Fix trigger gc not work (cherry picked from commit 147b5bf)
Ghatage
pushed a commit
to sijie/bookkeeper
that referenced
this pull request
Jul 12, 2024
* Fix trigger gc not work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
When I use
curl -XPUT http://<ip>:<port>/api/v1/bookie/gccommand to trigger garbage compaction, the bookie server returnsInternal Server Error. Then I checked the bookie server's log, and nothing was found.After a deep debugging of the server, I found the following exception.
This bug is introduced by #3205. When we use
curl -XPUT http://<ip>:<port>/api/v1/bookie/gccommand to trigger gc, the request body is empty string, but notnull.bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerGCService.java
Lines 67 to 75 in ffc8e8b
It will enter Line#68 but goes into Line#71. It uses
JsonUtil.fromJsonto parse an empty string will throw the above exception and will return500to the client but no logs in the server side.Changes