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 2022/08/02 03:12:47 UTC
[GitHub] [hudi] YuweiXiao opened a new pull request, #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
YuweiXiao opened a new pull request, #6273:
URL: https://github.com/apache/hudi/pull/6273
## *Tips*
- *Thank you very much for contributing to Apache Hudi.*
- *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
## What is the purpose of the pull request
Patch to ensure `StreamWriteOperatorCoordinator` do re-commit during restart when the `write.tasks` parameter changes.
For details, please check out [HUDI-4521](https://issues.apache.org/jira/browse/HUDI-4521).
## Brief change log
- Persist `write.tasks` parameter (i.e., parallelism) in writers' ckp states.
- Include `parallelism` and `total event number` in the bootstrap metadata event.
- Use `parallelism` & `total event number` to determine whether or not to do the re-commit, rather than relying on the slot number (i.e., the current `write.tasks` setup).
## Verify this pull request
Unit tests is added to verify the changes.
## Committer checklist
- [x] Has a corresponding JIRA in PR title & commit
- [x] 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] danny0405 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r937366454
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
> we have to validate number of events against parallelism of the last run.
There is no need to validate it, the checkpoint mechanism would ensure the integrity of the metadata events.
--
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
Re: [PR] [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism) [hudi]
Posted by "voonhous (via GitHub) via commits" <co...@hudi.apache.org>.
voonhous closed pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
URL: https://github.com/apache/hudi/pull/6273
--
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 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r935191813
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
The fix may be right but there are some thoughts about code engineering:
1. we should not put static config options in `WriteMetadataEvent` which is a dynamic metadata event from write task.
2. do we really need to care about the parallelism of last run ? Can we just merge the bootstrap events first before sending it to the coordinator ?
--
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 #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1203751677
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552",
"triggerID" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 3a89ed4fcc9f07b6e7370f05bf24224844425b68 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516)
* 99b468ea0a057159e72ef19c4f5a778639d2f757 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r937676670
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
And in the case where we increase the parallelism (e.g., 4 -> 8), empty bootstrap events will be sent by writers. Following the old logic, the re-commit may be skipped because the last message received by the coordinator may be an empty events rather than events with instant time.
--
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 #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1203954396
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552",
"triggerID" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "1203900476",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 99b468ea0a057159e72ef19c4f5a778639d2f757 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r936240587
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
Yes, so I add `eventNumOfTask`/`mergeCount` variables and change the eager commit behavior. Following your 'merge before send' suggestion, the `mergeCount` is no longer needed.
--
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 #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1203765016
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552",
"triggerID" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 99b468ea0a057159e72ef19c4f5a778639d2f757 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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 commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1201969875
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 801f948ec0ff03b98b993dd1e94ff099355a3ac7 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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 commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1202005926
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 801f948ec0ff03b98b993dd1e94ff099355a3ac7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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 commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1202081210
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 801f948ec0ff03b98b993dd1e94ff099355a3ac7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511)
* 3a89ed4fcc9f07b6e7370f05bf24224844425b68 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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 commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1202084779
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 801f948ec0ff03b98b993dd1e94ff099355a3ac7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511)
* 3a89ed4fcc9f07b6e7370f05bf24224844425b68 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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] danny0405 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r936409384
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
Yes, merge events before sending to coordinator makes the logic much simpler.
--
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 #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1203960235
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552",
"triggerID" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552",
"triggerID" : "1203900476",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 99b468ea0a057159e72ef19c4f5a778639d2f757 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10552)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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 commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1201967526
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 801f948ec0ff03b98b993dd1e94ff099355a3ac7 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r935320724
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
Yes, and those empty event will be excluded as the instant time is empty.
Lets say we increase `write.task` from 4 -> 8. During restart, we will receive 8 metadata event (with 4 empty bootstrap event and potentially more if some tasks failed to flush in the last run). In order to do know if the remaining non-empty metadata events are the full collection of events from last run, we have to get the parallelism of the last run (i.e., 4) rather than checking using the new parallelism (i.e., 8)
--
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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r937320948
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
Before means? Here we have to validate number of events against parallelism of the last run.
--
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
Re: [PR] [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism) [hudi]
Posted by "voonhous (via GitHub) via commits" <co...@hudi.apache.org>.
voonhous commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-6699957050
Temporarily closing this PR while we debug a GitHub settings error on master (#20471); it will be reopened shortly, no action needed.
--
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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r945434087
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
> Hello, is there any progress for this pr ?
Hey, sorry for the late reply. Could you help me understand why the validation is not necessary? Among those events sent by writers, they could be empty or carrying metadata, which should be normal in changing parallelism case.
--
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 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r937320012
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
We can handle the bootstrap event just like before because we already merge them before sending.
--
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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r935236582
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
We have to persist the parallelism somewhere because it is used to validate if all flushes in the last run complete. And it may change across runs. So I choose the most straightforward way to store it (i.e., in metadata state). Another option is to let user to pass in parallelism of the last run through configs, which is not user-friendly as users need to understand the logic behind it.
Merging bootstrap events before sending it a good point! Will improve it and seems we could remove the transient variable `mergeCount` based on it.
--
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 #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1203746995
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
}, {
"hash" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "99b468ea0a057159e72ef19c4f5a778639d2f757",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 3a89ed4fcc9f07b6e7370f05bf24224844425b68 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516)
* 99b468ea0a057159e72ef19c4f5a778639d2f757 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r937664991
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
Hey Danny, it is true that the validation is not necessary if we use the same `write.task` across runs. But it may not be the case when users change the write parallelism across runs.
For example, when the user reduces parallelism from 8 -> 4, the coordinator will receive 4 merged events with the merging optimization you proposed. To determine if we can do re-commit, we need to validate the events against 8 rather than only checking if all 4 event buffer are not empty. This is also way I persist parallelism to the writer state now since it may be used in the next run.
Not sure if there is better solution to this and the fix may not be helpful in most cases. But for usecases where the source purely relies on Flink ckp to determine the consumption offset, the mis-handling of re-commit during restart may cause lost of one batch data in the hudi side (or duplicate data).
--
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 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r935314375
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
> We have to persist the parallelism somewhere because it is used to validate if all flushes in the last run complete. And it may change across runs
Did you notice that we send an empty bootstrap event even if there is nothing in the metadata state ? There are 2 cases that the metadata state is empty:
1. the first run of the app
2. the parallelism is tweaked as larger: say from 4 to 8
And in this case ,we still send bootstrap event to coordinator so that it can be used for validation.
--
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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r935320724
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
Yes, and those empty event will be excluded as the instant time is empty.
Lets say we increase `write.task` from 4 -> 8. During restart, we will receive 8 metadata event (with 4 empty bootstrap event). In order to do know if the remaining non-empty metadata events are the full collection of events from last run, we have to get the parallelism of the last run (i.e., 4) rather than checking using the new parallelism (i.e., 8)
--
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 commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1214594159
Hello, is there any progress for this 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.
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 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r935314375
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
> We have to persist the parallelism somewhere because it is used to validate if all flushes in the last run complete. And it may change across runs
Did you notice that we send an empty bootstrap event even if there is nothing in the metadata state ?
--
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 #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1202227986
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10511",
"triggerID" : "801f948ec0ff03b98b993dd1e94ff099355a3ac7",
"triggerType" : "PUSH"
}, {
"hash" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516",
"triggerID" : "3a89ed4fcc9f07b6e7370f05bf24224844425b68",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 3a89ed4fcc9f07b6e7370f05bf24224844425b68 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10516)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@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] danny0405 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r936208671
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +379,28 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
Review Comment:
The operator state backend would spread the events evenly within the write tasks, and i want to say that the empty bootstrap event is also valid for coordinator validation.
But here is a problem, when we decrease the parallelism, one write task may have several bootstrap events, we should merge these events first before sending them to coordinator, or the coordinator may commit eagerly before it receives all the bootstrap events.
--
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] YuweiXiao commented on pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on PR #6273:
URL: https://github.com/apache/hudi/pull/6273#issuecomment-1203900476
@hudi-bot run azure
--
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 commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r937728962
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
> we need to validate the events against 8 rather than only checking if all 4 event buffer are not empty
We do not need to because we know that each write task sends only exactly one event.
--
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] YuweiXiao commented on a diff in pull request #6273: [HUDI-4521] Ensure flink coordinator do re-commit during restart for changing write.tasks number (i.e., write parallelism)
Posted by GitBox <gi...@apache.org>.
YuweiXiao commented on code in PR #6273:
URL: https://github.com/apache/hudi/pull/6273#discussion_r945434087
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -378,6 +378,27 @@ private void startInstant() {
this.conf.getString(FlinkOptions.TABLE_NAME), conf.getString(FlinkOptions.TABLE_TYPE));
}
+ /**
+ * Get the valid instant time of last batch from bootstrap events
+ * Return Option.empty() to indicate the instant is invalid from last batch
+ */
+ protected Option<String> bootstrapInstantFromEventBuffer() {
+ ValidationUtils.checkArgument(Arrays.stream(eventBuffer).allMatch(evt -> evt != null && evt.isBootstrap()));
+ List<WriteMetadataEvent> events = Arrays.stream(eventBuffer).filter(evt -> !evt.getInstantTime().equals("")).collect(Collectors.toList());
+ String instant = events.stream().map(WriteMetadataEvent::getInstantTime).reduce((a, b) -> a.equals(b) ? a : "").orElse("");
+ // instant and parallelism should be unique
+ if (instant.equals("")) {
+ return Option.empty();
+ }
+ int parallelism = events.stream().map(WriteMetadataEvent::getParallelism).reduce((a, b) -> a.equals(b) ? a : -1).orElse(-1);
+ if (parallelism == -1) {
+ return Option.empty();
+ }
+
+ int totalNumOfMetadataStates = events.stream().mapToInt(WriteMetadataEvent::getNumOfMetadataState).sum();
Review Comment:
> Hello, is there any progress for this pr ?
Hey, sorry for the late reply. Could you help me understand why the validation is not necessary? Among those events sent by writers, they could be empty or carry metadata, which should be normal in changing parallelism case.
--
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