You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/07/21 12:21:56 UTC
[GitHub] [hudi] danny0405 opened a new pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
danny0405 opened a new pull request #3320:
URL: https://github.com/apache/hudi/pull/3320
## *Tips*
- *Thank you very much for contributing to Apache Hudi.*
- *Please review https://hudi.apache.org/contributing.html before opening a pull request.*
## What is the purpose of the pull request
*(For example: This pull request adds quick-start document.)*
## Brief change log
*(for example:)*
- *Modify AnnotationLocation checkstyle rule in checkstyle.xml*
## Verify this pull request
*(Please pick either of the following options)*
This pull request is a trivial rework / code cleanup without any test coverage.
*(or)*
This pull request 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.*
- *Added HoodieClientWriteTest to verify the change.*
- *Manually verified the change by running a job locally.*
## Committer checklist
- [ ] Has a corresponding JIRA in PR title & commit
- [ ] Commit message is descriptive of the change
- [ ] CI is green
- [ ] Necessary doc changes done or have another open PR
- [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#issuecomment-884147968
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f78e6895777d92f99e38656dd27a33429332db81",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "f78e6895777d92f99e38656dd27a33429332db81",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* f78e6895777d92f99e38656dd27a33429332db81 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run travis` re-run the last Travis build
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] garyli1019 merged pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
garyli1019 merged pull request #3320:
URL: https://github.com/apache/hudi/pull/3320
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot edited a comment on pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#issuecomment-884147968
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f78e6895777d92f99e38656dd27a33429332db81",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078",
"triggerID" : "f78e6895777d92f99e38656dd27a33429332db81",
"triggerType" : "PUSH"
}, {
"hash" : "366b004cab33c57b04bac119a6a50df3b7aa5dc6",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "366b004cab33c57b04bac119a6a50df3b7aa5dc6",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* f78e6895777d92f99e38656dd27a33429332db81 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078)
* 366b004cab33c57b04bac119a6a50df3b7aa5dc6 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run travis` re-run the last Travis build
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot edited a comment on pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#issuecomment-884147968
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f78e6895777d92f99e38656dd27a33429332db81",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078",
"triggerID" : "f78e6895777d92f99e38656dd27a33429332db81",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* f78e6895777d92f99e38656dd27a33429332db81 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run travis` re-run the last Travis build
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot edited a comment on pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#issuecomment-884147968
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f78e6895777d92f99e38656dd27a33429332db81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078",
"triggerID" : "f78e6895777d92f99e38656dd27a33429332db81",
"triggerType" : "PUSH"
}, {
"hash" : "366b004cab33c57b04bac119a6a50df3b7aa5dc6",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1099",
"triggerID" : "366b004cab33c57b04bac119a6a50df3b7aa5dc6",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 366b004cab33c57b04bac119a6a50df3b7aa5dc6 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1099)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run travis` re-run the last Travis build
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot edited a comment on pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#issuecomment-884147968
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f78e6895777d92f99e38656dd27a33429332db81",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078",
"triggerID" : "f78e6895777d92f99e38656dd27a33429332db81",
"triggerType" : "PUSH"
}, {
"hash" : "366b004cab33c57b04bac119a6a50df3b7aa5dc6",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1099",
"triggerID" : "366b004cab33c57b04bac119a6a50df3b7aa5dc6",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* f78e6895777d92f99e38656dd27a33429332db81 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078)
* 366b004cab33c57b04bac119a6a50df3b7aa5dc6 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1099)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run travis` re-run the last Travis build
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] garyli1019 commented on a change in pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
garyli1019 commented on a change in pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#discussion_r674883435
##########
File path: hudi-flink/src/test/java/org/apache/hudi/utils/TestCompactionUtil.java
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.utils;
+
+import org.apache.hudi.avro.model.HoodieCompactionOperation;
+import org.apache.hudi.avro.model.HoodieCompactionPlan;
+import org.apache.hudi.client.HoodieFlinkWriteClient;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.table.timeline.HoodieActiveTimeline;
+import org.apache.hudi.common.table.timeline.HoodieInstant;
+import org.apache.hudi.common.table.timeline.HoodieTimeline;
+import org.apache.hudi.common.table.timeline.TimelineMetadataUtils;
+import org.apache.hudi.configuration.FlinkOptions;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.hudi.table.HoodieFlinkTable;
+import org.apache.hudi.util.CompactionUtil;
+import org.apache.hudi.util.StreamerUtil;
+
+import org.apache.flink.configuration.Configuration;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Test cases for {@link org.apache.hudi.util.CompactionUtil}.
+ */
+public class TestCompactionUtil {
+
+ @TempDir
+ File tempFile;
+
+ @Test
+ void rollbackCompaction() throws IOException {
+ Configuration conf = TestConfigurations.getDefaultConf(tempFile.getAbsolutePath());
+ conf.setInteger(FlinkOptions.COMPACTION_DELTA_SECONDS, 0);
+
+ StreamerUtil.initTableIfNotExists(conf);
+
+ HoodieFlinkWriteClient writeClient = StreamerUtil.createWriteClient(conf, null);
+ HoodieFlinkTable table = writeClient.getHoodieTable();
+ HoodieTableMetaClient metaClient = table.getMetaClient();
+
+ HoodieCompactionOperation operation = new HoodieCompactionOperation();
+ HoodieCompactionPlan plan = new HoodieCompactionPlan(Collections.singletonList(operation), Collections.emptyMap(), 1);
+ String instantTime = HoodieActiveTimeline.createNewInstantTime();
+ HoodieInstant compactionInstant =
+ new HoodieInstant(HoodieInstant.State.REQUESTED, HoodieTimeline.COMPACTION_ACTION, instantTime);
+ try {
+ metaClient.getActiveTimeline().saveToCompactionRequested(compactionInstant,
+ TimelineMetadataUtils.serializeCompactionPlan(plan));
+ table.getActiveTimeline().transitionCompactionRequestedToInflight(compactionInstant);
+ } catch (IOException ioe) {
+ throw new HoodieIOException("Exception scheduling compaction", ioe);
+ }
+ metaClient.reloadActiveTimeline();
+ HoodieInstant instant = metaClient.getActiveTimeline().filterPendingCompactionTimeline().lastInstant().orElse(null);
+ assertThat(instant.getTimestamp(), is(instantTime));
+
+ CompactionUtil.rollbackCompaction(table, writeClient, conf);
+ HoodieInstant rollbackInstant = table.getActiveTimeline().filterPendingCompactionTimeline().lastInstant().get();
+ assertThat(rollbackInstant.getState(), is(HoodieInstant.State.REQUESTED));
Review comment:
really appreciate the test :)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] danny0405 closed pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
danny0405 closed pull request #3320:
URL: https://github.com/apache/hudi/pull/3320
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] garyli1019 commented on a change in pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
garyli1019 commented on a change in pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#discussion_r674542174
##########
File path: hudi-flink/src/main/java/org/apache/hudi/util/CompactionUtil.java
##########
@@ -94,7 +95,7 @@ public static void cleanInstant(HoodieTableMetaClient metaClient, HoodieInstant
}
}
- public static void rollbackCompaction(HoodieFlinkTable<?> table, Configuration conf) {
+ public static void rollbackCompaction(HoodieFlinkTable<?> table, HoodieFlinkWriteClient writeClient, Configuration conf) {
Review comment:
can we test this?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot edited a comment on pull request #3320: [HUDI-2205] Rollback inflight compaction for flink writer
Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3320:
URL: https://github.com/apache/hudi/pull/3320#issuecomment-884147968
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f78e6895777d92f99e38656dd27a33429332db81",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078",
"triggerID" : "f78e6895777d92f99e38656dd27a33429332db81",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* f78e6895777d92f99e38656dd27a33429332db81 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1078)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run travis` re-run the last Travis build
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org