You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/05/11 16:03:37 UTC
[GitHub] [flink] dawidwys opened a new pull request #15897: Flink 22638
dawidwys opened a new pull request #15897:
URL: https://github.com/apache/flink/pull/15897
## What is the purpose of the change
Improve the end to end checkpointing time in case alignment timeout occurs.
## Brief change log
See the commits
## Verifying this change
Updated tests.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / **no**)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
- The serializers: (yes / **no** / don't know)
- The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (**yes** / no / don't know)
- The S3 file system connector: (yes / **no** / don't know)
## Documentation
- Does this pull request introduce a new feature? (yes / **no**)
- If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
--
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
[GitHub] [flink] dawidwys commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-842055542
--
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
[GitHub] [flink] curcur commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r634518013
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingCollectingBarriersUnaligned.java
##########
@@ -74,14 +74,15 @@ public BarrierHandlerState abort(long cancelledId) throws IOException {
return stopCheckpoint(cancelledId);
}
- private BarrierHandlerState stopCheckpoint(long cancelledId) {
- for (CheckpointableInput input : inputs) {
+ private BarrierHandlerState stopCheckpoint(long cancelledId) throws IOException {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStopped(cancelledId);
}
+ channelState.unblockAllChannels();
if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
+ return new AlternatingWaitingForFirstBarrier(channelState.emptyState());
} else {
- return new WaitingForFirstBarrierUnaligned(false, inputs);
+ return new AlternatingWaitingForFirstBarrierUnaligned(false, channelState);
Review comment:
Should this be `channelState.emptyState()` for unaligned checkpoint as well?
I guess it means the same thing because AlternatingWaitingForFirstBarrierUnaligned(false,...) does not have announcements? But this requires explicit knowledge and implicit assumption of that.
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838749511
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit bab49830766420e0ec4adfd14942b4bf1a0a8a4f (Sat Aug 28 12:11:27 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] curcur commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r634539828
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
}
CheckpointBarrier unalignedBarrier = checkpointBarrier.asUnaligned();
controller.initInputsCheckpoint(unalignedBarrier);
- for (CheckpointableInput input : inputs) {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStarted(unalignedBarrier);
}
controller.triggerGlobalCheckpoint(unalignedBarrier);
if (controller.allBarriersReceived()) {
- for (CheckpointableInput input : inputs) {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStopped(unalignedBarrier.getId());
}
- if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
- } else {
- return this;
- }
+ return stopCheckpoint();
}
- return new CollectingBarriersUnaligned(alternating, inputs);
+ return new AlternatingCollectingBarriersUnaligned(alternating, channelState);
}
@Override
- public BarrierHandlerState abort(long cancelledId) {
+ public BarrierHandlerState abort(long cancelledId) throws IOException {
+ return stopCheckpoint();
+ }
+
+ private BarrierHandlerState stopCheckpoint() throws IOException {
+ channelState.unblockAllChannels();
if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
+ return new AlternatingWaitingForFirstBarrier(channelState.emptyState());
} else {
return this;
Review comment:
Should the channelstate of "this" be empty, same as what I commented above.
--
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
[GitHub] [flink] flinkbot commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838749511
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 659023b1937b4e105dde32fb772c6b771b597ee6 (Tue May 11 16:07:04 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dawidwys commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r635246250
##########
File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingCheckpointsTest.java
##########
@@ -507,13 +477,20 @@ public void testAllChannelsUnblockedAfterAlignmentTimeout() throws Exception {
// we set timer on announcement and test channels do not produce announcements by themselves
send(EventSerializer.toBuffer(new EventAnnouncement(checkpointBarrier, 0), true), 0, gate);
- send(checkpointBarrierBuffer, 0, gate);
// emulate blocking channels on aligned barriers
((TestInputChannel) gate.getChannel(0)).setBlocked(true);
Review comment:
Yes, it is. I agree it is a bit confusing. The network stack actually blocks the regular channels. Therefore the calls in `BarrierHandlerState` are necessary only for bookkeeping to unblock them in the end. This emulates the network stack behaviour.
See
```
public abstract class IndexedInputGate extends InputGate implements CheckpointableInput {
....
@Override
public void blockConsumption(InputChannelInfo channelInfo) {
// Unused. Network stack is blocking consumption automatically by revoking credits.
}
...
}
```
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 659023b1937b4e105dde32fb772c6b771b597ee6 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
--
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
[GitHub] [flink] dawidwys commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r635233648
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AbstractAlternatingAlignedBarrierHandlerState.java
##########
@@ -72,7 +71,11 @@ public final BarrierHandlerState barrierReceived(
@Override
public final BarrierHandlerState abort(long cancelledId) throws IOException {
+ return stopCheckpoint();
+ }
+
+ private BarrierHandlerState stopCheckpoint() throws IOException {
Review comment:
Makes sense. I also did not like the name. Could not come up with a better one.
--
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
[GitHub] [flink] curcur commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-843760620
@dawidwys Hey Dawid, thanks very much for the PR. I did one pass and I do not see any obvious problem with the change of "blocking after receiving barrier". There are some inline comments above + a few more comments in general (which may not directly related the change made here)
1. I think it worth some explanation (one-sentense doc) for these four states, especially for the flag `alternating`, it would be even better to describe the transition relations between these four (But I do not think this has to be included in this PR though).
- AlternatingWaitingForFirstBarrier
- AlternatingCollectingBarriers
- AlternatingWaitingForFirstBarrierUnaligned
- AlternatingCollectingBarriersUnaligned
2. Do we need a test specifically to test the channels are blocked (for this change)?
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
}, {
"hash" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014",
"triggerID" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 659023b1937b4e105dde32fb772c6b771b597ee6 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874)
* 4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
}, {
"hash" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014",
"triggerID" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"triggerType" : "PUSH"
}, {
"hash" : "bab49830766420e0ec4adfd14942b4bf1a0a8a4f",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18142",
"triggerID" : "bab49830766420e0ec4adfd14942b4bf1a0a8a4f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* bab49830766420e0ec4adfd14942b4bf1a0a8a4f Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18142)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] curcur commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r634533055
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
Review comment:
I am a bit struggling thinking of cases where out-of-order barriers come? Since transition happens when AlternatingWaitingForFirstBarrier#alignmentTimeout, and converting to priority events happen before transition. On the other hand, all barriers seen has already have the announcement removed.
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 659023b1937b4e105dde32fb772c6b771b597ee6 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 659023b1937b4e105dde32fb772c6b771b597ee6 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dawidwys closed pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys closed pull request #15897:
URL: https://github.com/apache/flink/pull/15897
--
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
[GitHub] [flink] dawidwys commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r635235541
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingCollectingBarriersUnaligned.java
##########
@@ -74,14 +74,15 @@ public BarrierHandlerState abort(long cancelledId) throws IOException {
return stopCheckpoint(cancelledId);
}
- private BarrierHandlerState stopCheckpoint(long cancelledId) {
- for (CheckpointableInput input : inputs) {
+ private BarrierHandlerState stopCheckpoint(long cancelledId) throws IOException {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStopped(cancelledId);
}
+ channelState.unblockAllChannels();
if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
+ return new AlternatingWaitingForFirstBarrier(channelState.emptyState());
} else {
- return new WaitingForFirstBarrierUnaligned(false, inputs);
+ return new AlternatingWaitingForFirstBarrierUnaligned(false, channelState);
Review comment:
It should be `emptyState`, yes.
--
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
[GitHub] [flink] dawidwys commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-844119014
Ad. 2 I think correctness-wise it does not make a difference when the channels are unblocked. What we care about is that the channels are unblocked once a checkpoint finishes (either completed or aborted). I would not enforce that contract in unit tests. It is kind of covered by the performance tests. If we say at some point that actually it's better to unblock the channels as soon as possible we can change it easily. WDYT?
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
}, {
"hash" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 659023b1937b4e105dde32fb772c6b771b597ee6 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874)
* 4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] curcur commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r634533055
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
Review comment:
I am a bit struggling thinking of cases where out-of-order barriers come? Since transition happens when AlternatingWaitingForFirstBarrier#alignmentTimeout, and converting to priority events happens before transition.
--
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
[GitHub] [flink] dawidwys commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-842325659
@curcur Do you mind taking a look?
--
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
[GitHub] [flink] dawidwys commented on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
dawidwys commented on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-842055542
@pnowojski What do you think about those changes?
--
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
[GitHub] [flink] curcur commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r634345124
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AbstractAlternatingAlignedBarrierHandlerState.java
##########
@@ -72,7 +71,11 @@ public final BarrierHandlerState barrierReceived(
@Override
public final BarrierHandlerState abort(long cancelledId) throws IOException {
+ return stopCheckpoint();
+ }
+
+ private BarrierHandlerState stopCheckpoint() throws IOException {
Review comment:
this name (`stopCheckPoint`) is a bit confusing, it is more like resuming to a fresh consumption state instead of `stopCheckpoint`? This is also called right after `controller.triggerGlobalCheckpoint(checkpointBarrier);` sounds like we stop the checkpoint right after triggering it. Maybe `finishCheckpoint`?
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
}
CheckpointBarrier unalignedBarrier = checkpointBarrier.asUnaligned();
controller.initInputsCheckpoint(unalignedBarrier);
- for (CheckpointableInput input : inputs) {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStarted(unalignedBarrier);
}
controller.triggerGlobalCheckpoint(unalignedBarrier);
if (controller.allBarriersReceived()) {
- for (CheckpointableInput input : inputs) {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStopped(unalignedBarrier.getId());
}
- if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
- } else {
- return this;
- }
+ return stopCheckpoint();
}
- return new CollectingBarriersUnaligned(alternating, inputs);
+ return new AlternatingCollectingBarriersUnaligned(alternating, channelState);
}
@Override
- public BarrierHandlerState abort(long cancelledId) {
+ public BarrierHandlerState abort(long cancelledId) throws IOException {
+ return stopCheckpoint();
+ }
+
+ private BarrierHandlerState stopCheckpoint() throws IOException {
+ channelState.unblockAllChannels();
if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
+ return new AlternatingWaitingForFirstBarrier(channelState.emptyState());
} else {
return this;
Review comment:
Should the channelstate of "this" be empty, same as above.
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
Review comment:
I am a bit struggling thinking of cases where out-of-order barriers come? Since transition happens when AlternatingWaitingForFirstBarrier#alignmentTimeout, and converting to prior events happen before transition.
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
Review comment:
The comment needs to be updated accordingly.
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingCollectingBarriersUnaligned.java
##########
@@ -74,14 +74,15 @@ public BarrierHandlerState abort(long cancelledId) throws IOException {
return stopCheckpoint(cancelledId);
}
- private BarrierHandlerState stopCheckpoint(long cancelledId) {
- for (CheckpointableInput input : inputs) {
+ private BarrierHandlerState stopCheckpoint(long cancelledId) throws IOException {
+ for (CheckpointableInput input : channelState.getInputs()) {
input.checkpointStopped(cancelledId);
}
+ channelState.unblockAllChannels();
if (alternating) {
- return new AlternatingWaitingForFirstBarrier(inputs);
+ return new AlternatingWaitingForFirstBarrier(channelState.emptyState());
} else {
- return new WaitingForFirstBarrierUnaligned(false, inputs);
+ return new AlternatingWaitingForFirstBarrierUnaligned(false, channelState);
Review comment:
Should this be `channelState.emptyState()` for unaligned checkpoint as well?
I guess it means the same thing because AlternatingWaitingForFirstBarrierUnaligned(false,...) does not have announcements? But this requires the knowledge and implicit assumption of that.
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingCollectingBarriersUnaligned.java
##########
@@ -60,7 +60,7 @@ public BarrierHandlerState barrierReceived(
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
Review comment:
The comment needs to be updated accordingly.
##########
File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingCheckpointsTest.java
##########
@@ -507,13 +477,20 @@ public void testAllChannelsUnblockedAfterAlignmentTimeout() throws Exception {
// we set timer on announcement and test channels do not produce announcements by themselves
send(EventSerializer.toBuffer(new EventAnnouncement(checkpointBarrier, 0), true), 0, gate);
- send(checkpointBarrierBuffer, 0, gate);
// emulate blocking channels on aligned barriers
((TestInputChannel) gate.getChannel(0)).setBlocked(true);
Review comment:
Is this necessary? The channel is blocked after receiving the first aliged barrier in
AbstractAlternatingAlignedBarrierHandlerState#barrierReceived
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
}, {
"hash" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014",
"triggerID" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"triggerType" : "PUSH"
}, {
"hash" : "bab49830766420e0ec4adfd14942b4bf1a0a8a4f",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "bab49830766420e0ec4adfd14942b4bf1a0a8a4f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014)
* bab49830766420e0ec4adfd14942b4bf1a0a8a4f UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
}, {
"hash" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014",
"triggerID" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] curcur commented on a change in pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
curcur commented on a change in pull request #15897:
URL: https://github.com/apache/flink/pull/15897#discussion_r634533055
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/checkpointing/AlternatingWaitingForFirstBarrierUnaligned.java
##########
@@ -57,35 +57,37 @@ public BarrierHandlerState barrierReceived(
InputChannelInfo channelInfo,
CheckpointBarrier checkpointBarrier)
throws CheckpointException, IOException {
+
// we received an out of order aligned barrier, we should resume consumption for the
// channel, as it is being blocked by the credit-based network
if (!checkpointBarrier.getCheckpointOptions().isUnalignedCheckpoint()) {
- inputs[channelInfo.getGateIdx()].resumeConsumption(channelInfo);
+ channelState.blockChannel(channelInfo);
Review comment:
I am a bit struggling thinking of cases where out-of-order barriers come? Since transition happens when AlternatingWaitingForFirstBarrier#alignmentTimeout, and converting to priority events happen before transition. All barriers seen has already have the announcement removed.
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #15897: [FLINK-22638] Keep channels blocked on alignment timeout
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15897:
URL: https://github.com/apache/flink/pull/15897#issuecomment-838767418
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=17874",
"triggerID" : "659023b1937b4e105dde32fb772c6b771b597ee6",
"triggerType" : "PUSH"
}, {
"hash" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014",
"triggerID" : "4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8",
"triggerType" : "PUSH"
}, {
"hash" : "bab49830766420e0ec4adfd14942b4bf1a0a8a4f",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18142",
"triggerID" : "bab49830766420e0ec4adfd14942b4bf1a0a8a4f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4d404aa0d2edb50ed33ec7e005beaaab65ee3fb8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18014)
* bab49830766420e0ec4adfd14942b4bf1a0a8a4f Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18142)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org