Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport: shortcut local execution #10350

Closed
wants to merge 4 commits into from

Commits on Mar 31, 2015

  1. Transport: shortcut local execution

    In several places in the code we need to notify a node it needs to do something (typically the master). When that node is the local node, we have an optimization in serveral places that runs the execution code immediately instead of sending the request through the wire to itself. This is a shame as we need to implement the same pattern again and again. On top of that we may forget (see note bellow) to do so and we might have to write some craft if the code need to run under another thread pool.
    
    This commit folds the optimization in the TrasnportService, shortcutting wire serliazition if the target node is local.
    
    Note: this was discovered by elastic#10247 which tries to import a dangling index quickly after the cluster forms. When sending an import dangling request to master, the code didn't take into account that fact that the local node may master. If this happens quickly enough, one would get a NodeNotConnected exception causing the dangling indices not to be imported. This will succeed after 10s where InternalClusterService.ReconnectToNodes runs and actively connects the local node to itself (which is not needed), potentially after another cluster state update.
    bleskes committed Mar 31, 2015
    Copy the full SHA
    1b50945 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2015

  1. feedback

    bleskes committed Apr 2, 2015
    Copy the full SHA
    4ae82ca View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    aa43690 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    de66767 View commit details
    Browse the repository at this point in the history