wsry opened a new pull request #11877:
URL: https://github.com/apache/flink/pull/11877
## What is the purpose of the change
This is the second ingredient besides FLINK-16404 to solve the deadlock
problem without exclusive buffers.
The scenario is as follows:
The data in subpartition with positive backlog can be sent without doubt
because the exclusive credits would be feedback finally.
Without exclusive buffers, the receiver would not request floating buffers
for 0 backlog. But when the new backlog is added into such subpartition, it has
no way to notify the receiver side without positive credits ATM.
So it would result in waiting for each other between receiver and sender
sides to cause deadlock. The sender waits for credit to notify backlog and the
receiver waits for backlog to request floating credits.
To solve the above problem, the sender needs a separate message to announce
backlog sometimes besides existing `BufferResponse`. Then the receiver can get
this info to request floating buffers to feedback.
## Brief change log
- Add sender side backlog maintenance and announcement logic;
- Receiver side request floating buffers according to the sender's
announced backlog strictly;
- Test cases are added to verify the change.
## Verifying this change
This change is verified by both existing tests and newly added 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:
[email protected]