Giter Site home page Giter Site logo

Coalesce user events about serf HOT 12 CLOSED

hashicorp avatar hashicorp commented on July 22, 2024
Coalesce user events

from serf.

Comments (12)

mitchellh avatar mitchellh commented on July 22, 2024

We talked about this in IRC today. We came up with a few points:

  • You probably never want to replay events (even unique ones) on a manual serf join. It may be useful to add a flag to Serf.Join to ignore events from the push/pull sync.
  • Coalesce, like you said here, by default. Add a flag if you don't want it to coalesce. serf event -repeatable foo

from serf.

jpfuentes2 avatar jpfuentes2 commented on July 22, 2024

After our conversation last night since it's likely in the vast majority of use-cases you do not want the replay events, do you think it'd make more sense to make serf join ignore these events by default and the flag would instead accept them?

from serf.

mitchellh avatar mitchellh commented on July 22, 2024

@jpfuentes2 Yeah, we plan on implementing this very soon. The coalescing itself is a harder problem. Armon described it to me last night:

  1. You have nodes A+B in one Serf cluster.
  2. You have nodes C+D in another Serf cluster.
  3. Both clusters live on their own for some period of time, using events and what-not.
  4. You join B to C. Now the cluster becomes A+B+C+D.
  5. It is easy to coalesce the events on C, but then they all still get broadcast out to D (by A or B), which is much harder.

from serf.

darkone23 avatar darkone23 commented on July 22, 2024

looking forward to serf join --ignore-history or something similar

+1

from serf.

vmalloc avatar vmalloc commented on July 22, 2024

Just out of curiosity, how many events are backlogged? For sure it can't be infinite, right? Couldn't find any hint in the docs about that

from serf.

mitchellh avatar mitchellh commented on July 22, 2024

@vmalloc I believe 512, currently. This is hardcoded and non-configurable.

from serf.

mitchellh avatar mitchellh commented on July 22, 2024

@vmalloc Actually that might be 1024, its either 512 or 1024.

from serf.

armon avatar armon commented on July 22, 2024

@vmalloc I guess it depends on what you mean by backlogged. If you sit in a tight loop firing serf events, then the transmit queues will basically become infinitely backed up. They start to generate warnings about queue depth, but will otherwise not stop you. In terms of anti-entropy and ensuring message delivery, we have a config called EventBuffer (https://github.com/hashicorp/serf/blob/master/serf/config.go) which defaults to 512. EventBuffer controls how many events which we have received we keep around to perform anti-entropy. This is the buffer that gets 'replayed' when a partition heals or node joins, etc. Hope that makes sense!

from serf.

armon avatar armon commented on July 22, 2024

As of 331142d the ground work for this is in. When Join is called, ignoreOld can be used to avoid processing older messages. Events can be coalesced using configuration setting when starting serf, and it can be enabled/disabled on a per-message basis when an event is fired.

What is left now is to integrate this up into the agent and CLI. For now, the behavior of the agent/CLI is the same for compatibility. @mitchellh do you want to take this?

from serf.

mitchellh avatar mitchellh commented on July 22, 2024

Assigned to myself, I should have a PR for this very shortly.

from serf.

mitchellh avatar mitchellh commented on July 22, 2024

@armon Question: do you think user events should be coalescable by default? i.e. serf event foo == foo is coalesced? I think in the common case, coalescing is okay and may be expected behavior. But wanted to check.

from serf.

armon avatar armon commented on July 22, 2024

@mitchellh I think we coalesce by default yes, it seems like the expected case

from serf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.