Skip to content

Commit

Permalink
Enable bwc transform throttling (elastic#56189)
Browse files Browse the repository at this point in the history
re-enable and finish backport of elastic#56184
  • Loading branch information
Hendrik Muhs committed May 5, 2020
1 parent 35aef8b commit febff64
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ task verifyVersions {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/56184" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private Request(StreamInput in) throws IOException {
}

public static Request fromStreamWithBWC(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // todo: V_7_8_0
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
return new Request(in);
}
UpdateTransformActionPre78.Request r = new UpdateTransformActionPre78.Request(in);
Expand Down Expand Up @@ -130,7 +130,7 @@ public void setConfig(TransformConfig config) {

@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
super.writeTo(out);
update.writeTo(out);
out.writeString(id);
Expand Down Expand Up @@ -186,7 +186,7 @@ private Response(StreamInput in) throws IOException {
}

public static Response fromStreamWithBWC(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // todo: V_7_8_0
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
return new Response(in);
}
UpdateTransformActionPre78.Response r = new UpdateTransformActionPre78.Response(in);
Expand All @@ -199,7 +199,7 @@ public TransformConfig getConfig() {

@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
super.writeTo(out);
config.writeTo(out);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Request(TransformConfigUpdate update, String id, boolean deferValidation)

public Request(StreamInput in) throws IOException {
super(in);
assert in.getVersion().before(Version.V_8_0_0);// todo: V_7_8_0
assert in.getVersion().before(Version.V_7_8_0);
this.update = new TransformConfigUpdate(in);
this.id = in.readString();
this.deferValidation = in.readBoolean();
Expand All @@ -65,7 +65,7 @@ public TransformConfigUpdate getUpdate() {

@Override
public void writeTo(StreamOutput out) throws IOException {
assert out.getVersion().before(Version.V_8_0_0); // todo: V_7_8_0
assert out.getVersion().before(Version.V_7_8_0);
super.writeTo(out);
this.update.writeTo(out);
out.writeString(id);
Expand Down Expand Up @@ -104,7 +104,7 @@ public Response(TransformConfig config) {
}

public Response(StreamInput in) throws IOException {
assert in.getVersion().before(Version.V_8_0_0); // todo: V_7_8_0
assert in.getVersion().before(Version.V_7_8_0);
this.config = new TransformConfig(in);
}

Expand All @@ -114,7 +114,7 @@ public TransformConfig getConfig() {

@Override
public void writeTo(StreamOutput out) throws IOException {
assert out.getVersion().before(Version.V_8_0_0); // todo: V_7_8_0
assert out.getVersion().before(Version.V_7_8_0);
this.config.writeTo(out);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public TransformConfig(final StreamInput in) throws IOException {
createTime = null;
transformVersion = null;
}
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // todo: V_7_8_0
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
settings = new SettingsConfig(in);
} else {
settings = new SettingsConfig();
Expand Down Expand Up @@ -325,7 +325,7 @@ public void writeTo(final StreamOutput out) throws IOException {
out.writeBoolean(false);
}
}
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // todo: V_7_8_0
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
settings.writeTo(out);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public TransformConfigUpdate(final StreamInput in) throws IOException {
if (in.readBoolean()) {
setHeaders(in.readMap(StreamInput::readString, StreamInput::readString));
}
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // todo: V_7_8_0
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
settings = in.readOptionalWriteable(SettingsConfig::new);
} else {
settings = null;
Expand Down Expand Up @@ -158,7 +158,7 @@ public void writeTo(final StreamOutput out) throws IOException {
} else {
out.writeBoolean(false);
}
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
out.writeOptionalWriteable(settings);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ protected void doExecute(Task task, Request request, ActionListener<Response> li
if (transformTask != null
&& transformTask.getState() instanceof TransformState
&& ((TransformState) transformTask.getState()).getTaskState() != TransformTaskState.FAILED
&& clusterState.nodes().get(transformTask.getExecutorNode()).getVersion().onOrAfter(Version.V_8_0_0) // todo:
// V_7_8_0
&& clusterState.nodes().get(transformTask.getExecutorNode()).getVersion().onOrAfter(Version.V_7_8_0)
) {
request.setNodes(transformTask.getExecutorNode());
updateListener = ActionListener.wrap(updateResponse -> {
Expand Down

0 comments on commit febff64

Please sign in to comment.