Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-61259

Race condition in ns_tick_agent that can cause stats not being gathered

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      init([]) ->
          Master = mb_master:master_node(),
       
          Self = self(),
          ns_pubsub:subscribe_link(leader_events,
                                   case _ of
                                       {new_leader, _} = Event ->
                                           Self ! Event;
                                       _ ->
                                           ok
                                   end),
      

      We can see here that there's a tiny race condition: new_leader event might come after mb_master:master_node() returned undefined, but before the subscription to the event is established. In this case the event is lost and ns_tick_agent won't get another notification until the new master election occures.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            steve.watanabe Steve Watanabe
            artem Artem Stemkovski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty