[
https://issues.apache.org/jira/browse/FLINK-7468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16295300#comment-16295300
]
ASF GitHub Bot commented on FLINK-7468:
---------------------------------------
Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/4559#discussion_r157538818
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartitionTest.java
---
@@ -181,10 +182,27 @@ public void testConsumeSpilledPartition() throws
Exception {
partition.add(buffer);
partition.add(buffer);
+ assertEquals(3, partition.getTotalNumberOfBuffers());
+ assertEquals(3, partition.getBuffersInBacklog());
+ assertEquals(4096 * 3, partition.getTotalNumberOfBytes());
+
+ assertFalse(buffer.isRecycled());
assertEquals(3, partition.releaseMemory());
+ // now the buffer may be freed, depending on the timing of the
write operation
+ // -> let's do this check at the end of the test (to save some
time)
+ // still same statistics
+ assertEquals(3, partition.getTotalNumberOfBuffers());
+ assertEquals(3, partition.getBuffersInBacklog());
+ assertEquals(4096 * 3, partition.getTotalNumberOfBytes());
+
partition.finish();
+ // + one EndOfPartitionEvent
+ assertEquals(4, partition.getTotalNumberOfBuffers());
+ assertEquals(3, partition.getBuffersInBacklog());
+ assertEquals(4096 * 3 + 4, partition.getTotalNumberOfBytes());
--- End diff --
good, can you also add the backlog correctness checks to the
`reader.getNextBuffer()` lines below to ensure they are correct after taking
buffers out?
> Implement sender backlog logic for credit-based
> -----------------------------------------------
>
> Key: FLINK-7468
> URL: https://issues.apache.org/jira/browse/FLINK-7468
> Project: Flink
> Issue Type: Sub-task
> Components: Network
> Reporter: zhijiang
> Assignee: zhijiang
> Fix For: 1.5.0
>
>
> This is a part of work for credit-based network flow control.
> Receivers should know how many buffers are available on the sender side (the
> backlog). The receivers use this information to decide how to distribute
> floating buffers.
> The {{ResultSubpartition}} maintains the backlog which only indicates the
> number of buffers in this subpartition, not including the number of events.
> The backlog is increased for adding buffer to this subpartition, and
> decreased for polling buffer from it.
> The backlog is attached in {{BufferResponse}} by sender as an absolute value
> after the buffer being transferred.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)