You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/12/31 19:23:52 UTC
[GitHub] [druid] capistrant opened a new pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
capistrant opened a new pull request #10724:
URL: https://github.com/apache/druid/pull/10724
<!-- Thanks for trying to help us make Apache Druid be the best it can be! Please fill out as much of the following information as is possible (where relevant, and remove it when irrelevant) to help make the intention and scope of this PR clear in order to ease review. -->
Fixes #10723
<!-- Replace XXXX with the id of the issue fixed in this PR. Remove this section if there is no corresponding issue. Don't reference the issue in the title of this pull-request. -->
<!-- If you are a committer, follow the PR action item checklist for committers:
https://github.com/apache/druid/blob/master/dev/committer-instructions.md#pr-and-issue-action-item-checklist-for-committers. -->
### Description
<!-- Describe the goal of this PR, what problem are you fixing. If there is a corresponding issue (referenced above), it's not necessary to repeat the description here, however, you may choose to keep one summary sentence. -->
<!-- Describe your patch: what did you change in code? How did you fix the problem? -->
<!-- If there are several relatively logically separate changes in this PR, create a mini-section for each of them. For example: -->
#### Fixed the bug introduced in #10723
The mentioned change introduced undesirable behavior during upgrade. The new config value `percentOfSegmentsToConsiderPerMove` requires a value of 1 - 100. Default is 100. However on upgrade the coordinator will load the dynamic config from metastore using `CoordinatorDynamicConfig` for deserialization. Since the config will not have existed pre-upgrade, it will be null for the constructor which violates the precondition check on the value. This would cause the code to load the Builder default of CoordinatorDynamicConfig at startup. I believe this is undesirable. Instead we want Druid to load the existing persisted config with the default for the new config while logging a warn to the operator telling them their persisted config is out of date.
<!--
In each section, please describe design decisions made, including:
- Choice of algorithms
- Behavioral aspects. What configuration values are acceptable? How are corner cases and error conditions handled, such as when there are insufficient resources?
- Class organization and design (how the logic is split between classes, inheritance, composition, design patterns)
- Method organization and design (how the logic is split between methods, parameters and return types)
- Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics)
-->
<!-- It's good to describe an alternative design (or mention an alternative name) for every design (or naming) decision point and compare the alternatives with the designs that you've implemented (or the names you've chosen) to highlight the advantages of the chosen designs and names. -->
<!-- If there was a discussion of the design of the feature implemented in this PR elsewhere (e. g. a "Proposal" issue, any other issue, or a thread in the development mailing list), link to that discussion from this PR description and explain what have changed in your final design compared to your original proposal or the consensus version in the end of the discussion. If something hasn't changed since the original discussion, you can omit a detailed discussion of those aspects of the design here, perhaps apart from brief mentioning for the sake of readability of this PR description. -->
<!-- Some of the aspects mentioned above may be omitted for simple and small changes. -->
<hr>
This PR has:
- [ ] been self-reviewed.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] been tested in a test Druid cluster.
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist above are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
<hr>
##### Key changed/added classes in this PR
* CoordinatorDynamicConfig
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] suneet-s merged pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
suneet-s merged pull request #10724:
URL: https://github.com/apache/druid/pull/10724
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] suneet-s commented on pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
suneet-s commented on pull request #10724:
URL: https://github.com/apache/druid/pull/10724#issuecomment-755627357
@capistrant It looks like CI is complaining about a missing file for a newly added (I think) integration test 🤔 I'm not sure how this PR could have caused that failure - https://travis-ci.com/github/apache/druid/jobs/468930258 (I tried re-triggering this job a couple times just incase)
Could you maybe try merging master back into this PR to see if that will make Travis happy
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] clintropolis commented on a change in pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #10724:
URL: https://github.com/apache/druid/pull/10724#discussion_r553119211
##########
File path: server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
##########
@@ -87,6 +88,8 @@
private final int maxSegmentsInNodeLoadingQueue;
private final boolean pauseCoordination;
+ private static final EmittingLogger log = new EmittingLogger(CoordinatorDynamicConfig.class);
Review comment:
nit: I don't think this needs to be `EmittingLogger` since it isn't doing an alert anywhere
##########
File path: server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
##########
@@ -96,7 +99,7 @@ public CoordinatorDynamicConfig(
@JsonProperty("mergeBytesLimit") long mergeBytesLimit,
@JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit,
@JsonProperty("maxSegmentsToMove") int maxSegmentsToMove,
- @JsonProperty("percentOfSegmentsToConsiderPerMove") double percentOfSegmentsToConsiderPerMove,
+ @JsonProperty("percentOfSegmentsToConsiderPerMove") Double percentOfSegmentsToConsiderPerMove,
Review comment:
I guess the alternative way to fix this instead of switching out the primitive would be to treat `0` as not configured and so use the default of `100`, though this way seems fine too, I think it just sticks out a bit because the rest of the numbery parameters are primitives.
also nit: should annotate this parameter with `@Nullable`
i missed the first PR, but any reason this is a double instead of integer similar to other percent based config `decommissioningMaxPercentOfMaxSegmentsToMove`? I guess there can be millions of segments so the numbers being dealt with here are a bit different (at least hopefully no one is trying to actually move on the scale of that many segments per coordinator run..) so maybe those decimal points really do make a difference, but otoh I can't really imagine operators configuring this much more granular than integer numbers, which I think was the reason we used integer for the other one iirc.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] suneet-s commented on a change in pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
suneet-s commented on a change in pull request #10724:
URL: https://github.com/apache/druid/pull/10724#discussion_r551456475
##########
File path: server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
##########
@@ -126,6 +129,15 @@ public CoordinatorDynamicConfig(
this.mergeSegmentsLimit = mergeSegmentsLimit;
this.maxSegmentsToMove = maxSegmentsToMove;
+ if (percentOfSegmentsToConsiderPerMove == null) {
+ log.warn("percentOfSegmentsToConsiderPerMove was null! This is likely because your metastore does not "
Review comment:
I don't think this should be a warn log message. A user should not be expected to set an optional config. If the config is not set, it seems reasonable to me that the default is set to preserve the old behavior (ie all segments are considered per move).
For users who want to use the new behavior, I suspect they will hear about it in the release notes or the docs, and update the config to get the new functionality.
```suggestion
log.debug("percentOfSegmentsToConsiderPerMove was null! This is likely because your metastore does not "
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] jihoonson commented on pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
jihoonson commented on pull request #10724:
URL: https://github.com/apache/druid/pull/10724#issuecomment-756519969
@capistrant the code changes LGTM, but could you add a unit test that verifies JSON deserialization of `CoordinatorDynamicConfig` with missing `percentOfSegmentsToConsiderPerMove`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] suneet-s commented on a change in pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
suneet-s commented on a change in pull request #10724:
URL: https://github.com/apache/druid/pull/10724#discussion_r553486535
##########
File path: server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
##########
@@ -96,7 +99,7 @@ public CoordinatorDynamicConfig(
@JsonProperty("mergeBytesLimit") long mergeBytesLimit,
@JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit,
@JsonProperty("maxSegmentsToMove") int maxSegmentsToMove,
- @JsonProperty("percentOfSegmentsToConsiderPerMove") double percentOfSegmentsToConsiderPerMove,
+ @JsonProperty("percentOfSegmentsToConsiderPerMove") Double percentOfSegmentsToConsiderPerMove,
Review comment:
This was because of my comment in the initial PR - https://github.com/apache/druid/pull/10284#discussion_r546171183
I was thinking about developer error in calculating the percentage
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] capistrant commented on pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
capistrant commented on pull request #10724:
URL: https://github.com/apache/druid/pull/10724#issuecomment-753031710
@suneet-s I have added you as reviewer since you were reviewer on initial PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] capistrant commented on a change in pull request #10724: Coordinator Dynamic Config changes to ease upgrading with new config value
Posted by GitBox <gi...@apache.org>.
capistrant commented on a change in pull request #10724:
URL: https://github.com/apache/druid/pull/10724#discussion_r552218228
##########
File path: server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
##########
@@ -126,6 +129,15 @@ public CoordinatorDynamicConfig(
this.mergeSegmentsLimit = mergeSegmentsLimit;
this.maxSegmentsToMove = maxSegmentsToMove;
+ if (percentOfSegmentsToConsiderPerMove == null) {
+ log.warn("percentOfSegmentsToConsiderPerMove was null! This is likely because your metastore does not "
Review comment:
ya, I guess this is fine as a debug. It will actually automatically get set to the default (or the user specified value) the next time a user submits a new dynamic config since that code path uses builder which will populate missing values. will update now
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org