You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/24 11:19:03 UTC

[jira] [Commented] (FLINK-7078) Support fencing tokens to filter out outdated messages

    [ https://issues.apache.org/jira/browse/FLINK-7078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16139899#comment-16139899 ] 

ASF GitHub Bot commented on FLINK-7078:
---------------------------------------

GitHub user tillrohrmann opened a pull request:

    https://github.com/apache/flink/pull/4578

    [FLINK-7078] [rpc] Introduce FencedRpcEndpoint

    ## What is the purpose of the change
    
    Introduce `FencedRpcEndpoint` which requires all RPC messages to have a
    fencing token attached. Based on the received fencing token and the
    actual fencing token, the message will either be discarded if they are
    not equal or it will be processed. That way we are able to filter out
    old messages or messages which originate from a split brain situation.
    
    This PR is based on #4573.
    
    ## Brief change log
    
    - Introduce `FencedRpcEndpoint` which extends `RpcEndpoint` and adds fields for a fencing token
    - Introduce `FencedRpcGateway` which should be implemented by a `FencedRpcEndpoint` and gives access to the current fencing token
    - Introduce `FencedAkkaRpcActor` which filters out all messages which have not a proper fencing token attached
    - Introduce `FencedAkkaInvocationHandler` which attaches to all messages a fencing token
    - Introduce `FencedMainThreadExecutable` which allows to run code in the main thread without fencing token
    - Add `RcpService#connect(String, F, Time)` with `F` being the fencing token to connect to a `FencedRpcEndpoint`
    - Adapt the `AkkaRpcService` to start the correct `AkkaRpcActor` and instantiate the correct `InvocationHandler` when a `FencedRpcEndpoint` is started
    
    - The self gateway always picks up the current fencing token from the `FencedRpcEndpoint`
    - Remote gateways are bound to a fixed fencing token
    - The `MainThreadExecutor` of the `FencedRpcEndpoint` is always bound to the current value of the fencing token
    
    ## Verifying this change
    
    This change added tests and can be verified as follows:
    
    - `FencedRpcEndpointTest` which tests the setting of fencing tokens and filtering of messages
    - `AsyncCallsTest#testRunAsyncWithFencing` and `AsyncCallsTest#testRunAsyncWithoutFencing` which test the fencing of `runAsync` calls
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (yes)
      - If yes, how is the feature documented? (not applicable)
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tillrohrmann/flink rpcFencing

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4578.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4578
    
----
commit 4b1088243a24fc3791c56eff37e1ca5fada8afbd
Author: Till Rohrmann <tr...@apache.org>
Date:   2017-08-22T14:33:05Z

    [FLINK-7489] Remove startJobExecution and suspendExecution from JobMasterGateway
    
    The job lifecycle methods should not be exposed as RPCs. Therefore, this commit
    removes them from the JobMasterGateway definition.

commit b49297d365249a78680c9da6e982f099cd2871ed
Author: Till Rohrmann <tr...@apache.org>
Date:   2017-08-23T15:08:55Z

    [FLINK-7078] [rpc] Introduce FencedRpcEndpoint
    
    Introduce FencedRpcEndpoint which requires all RPC messages to have a
    fencing token attached. Based on the received fencing token and the
    actual fencing token, the message will either be discarded if they are
    not equal or it will be processed. That way we are able to filter out
    old messages or messages which originate from a split brain situation

----


> Support fencing tokens to filter out outdated messages
> ------------------------------------------------------
>
>                 Key: FLINK-7078
>                 URL: https://issues.apache.org/jira/browse/FLINK-7078
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>              Labels: flip-6
>
> In order to guard against split brain situations, it is important that RPC calls are guarded with a fencing token. The sender attaches his fencing token to a RPC message which is then used on the receiver side to compare against the expected fencing token. An example is the leader session ID which we attach to all critical RPC messages.
> So far, in the Flip-6 code base we send fencing tokens explicitly. This is not only cumbersome but also error-prone because you have to do it for all RPCs. Therefore, it would be better if we could automatically compare fencing tokens for a given RPC from a given source. This should ideally happen on the level of the RPC server.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)