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

Refactoring of output/mode/lb package #1551

Merged
merged 1 commit into from
May 2, 2016

Conversation

urso
Copy link

@urso urso commented May 2, 2016

  • Combine and move load balancer modes into output/mode/lb package (removes
    some duplicate code):
    • Split load balancer functionality into 3 components each:
      • Load balancer module forwarding events to workers
      • Context (queueing) defining load balancing strategy + redistribution of
        events on retry
      • Specialized sync/async workers processing events from context into
        (sync/async) protocol clients.
        Workers deal with client errors (reconnect + backoff strategy) and
        return unsuccessfully send events back into the load balancer context
  • async load balance worker always spawns go-routine for returning errors into
    retry queue (break potential deadlocks if errors are reported via queues).

@urso
Copy link
Author

urso commented May 2, 2016

blocked by #1550

- Combine and move load balancer modes into output/mode/lb package (removes
  some duplicate code):
  - Split load balancer functionality into 3 components each:
     - Load balancer module forwarding events to workers
     - Context (queueing) defining load balancing strategy + redistribution of
       events on retry
     - Specialized sync/async workers processing events from context into
       (sync/async) protocol clients.
       Workers deal with client errors (reconnect + backoff strategy) and
       return unsuccessfully send events back into the load balancer context
- async load balance worker always spawns go-routine for returning errors into
  retry queue (break potential deadlocks if errors are reported via queues).
event common.MapStr,
) error {
return m.publishEventsMessage(opts, eventsMessage{
worker: -1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my knowledge, what does the -1 signify here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worker is the worker-id processing a message. That is on error we can tell which worker did error. With ids currently starting with 0, the value -1 indicates the message not being processed before.

@tsg
Copy link
Contributor

tsg commented May 2, 2016

LGTM, waiting for travis.

@tsg tsg merged commit 4a8f00d into elastic:master May 2, 2016
@urso urso deleted the refactor/output-modes-lb branch February 19, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants