Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8988

Optimize GMSMembership.getMembersNotShuttingDown() to return a static list of members

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.15.0
    • None
    • membership
    • None

    Description

      In GEODE-7245 PR review, Jake suggested this change in GMSMembership.getMembersNotShuttingDown() method:

      If the shutdownMembers list isn't changing frequently, like every ms, then repeatedly recreating the same set is just adding pressure to the GC and CPU time all while under a synchronized lock for no real gain. I assume this shutdownMembers list is updated with the member id of the member that has said it is or has gone down, which isn't a frequent event in production. Seems like we should be optimizing this method to be returning a rather static list of members known not to be shutting down even if that means the infrequent setting of a shutting down member takes a bit more time to handle, by copying lists and invalidating or updating the not shutdown servers list.

       

      The fix for GEODE-7245 replaces synchronized blocks around shutdownMembers list with read/write locks. In GMSMembership.getMembersNotShuttingDown() method, shutdownMembers list is used to create a new collection of members not shutting down.  This method is called for every p2p message sent, so the proposed change is a reasonable optimization.
       
       

      Attachments

        1. call_counting.png
          613 kB
          Kamilla Aslami

        Activity

          People

            burcham Bill Burcham
            kaslami Kamilla Aslami
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: