Ejemplo n.º 1
0
/// Launch all Startup Phase threads.
void SipRegistrar::startupPhase()
{
   Os::Logger::instance().log(FAC_SIP, PRI_INFO, "SipRegistrar entering startup phase");

   // Create and start the persist thread, before making any changes
   // to the registration DB.
   createAndStartPersist();

   // Step (6) is not performed explicitly.  Instead, we allow the normal
   // operation of the RegistrarTest thread to do that processing.
}
Ejemplo n.º 2
0
/// Launch all Startup Phase threads.
void SipRegistrar::startupPhase()
{
   OsSysLog::add(FAC_SIP, PRI_INFO, "SipRegistrar entering startup phase");

   // Create and start the persist thread, before making any changes
   // to the registration DB.
   createAndStartPersist();

   if (mReplicationConfigured)
   {
      // Create replication-related thread objects, because they own some
      // the data that the RegistrarInitialSync thread needs,
      // but don't start them yet.
      createReplicationThreads();

      // Begin the RegistrarInitialSync thread and then wait for it.
      // The RegistrarInitialSync thread performs steps (1) to (4) of
      // section 5.7.1 of sipXregistry/doc/SyncDesign.*.
      OsSysLog::add(FAC_SIP, PRI_DEBUG,
                    "SipRegistrar::startupPhase starting initialSyncThread"
                    );
      mRegistrarInitialSync->start();
      yield();
      mRegistrarInitialSync->waitForCompletion();

      // The initial sync thread has no further value, to the ash heap of history it goes
      delete mRegistrarInitialSync;
      mRegistrarInitialSync = NULL;
   }
   else
   {
      OsSysLog::add(FAC_SIP, PRI_INFO,
                    "SipRegistrar::startupPhase no replication configured"
                    );
   }

   // Reset the DbUpdateNumber so that the upper half is the epoch time.
   // Step (5) in section 5.7.1 of sipXregistry/doc/SyncDesign.*.
   // We perform this even if there are no peer registrars to ensure that
   // update numbers are monotonic even if HA is enabled and then disabled.
   getRegistrarServer().resetDbUpdateNumberEpoch();

   // Step (6) is not performed explicitly.  Instead, we allow the normal
   // operation of the RegistrarTest thread to do that processing.
}