Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36407

Use AutoCollection instead of AutoCollectionForRead

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • 63

      Free Monitoring uses AutoCollectionForRead, unfortunately using this class can cause a deadlock with replication during startup. The deadlock can occurs because two the collection MODE_IS lock and _mutex in ReplicationCoordinatorImpl are taken in different orders The ReplicationCoordinatorImpl::_finishLoadLocalConfig method takes the {{_mutex first and then MODE_IS lock while AutoCollectionForRead takes it in the opposite order.

      A simple fix is to switch to AutoCollection since free monitoring does not need to wait for changes to replicate when it polls the local admin database on the primary or secondary.

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: