| | |
| | | { |
| | | try |
| | | { |
| | | try |
| | | { |
| | | // Acquire lock on domain (see more details in comment of start() |
| | | // method of ServerHandler) |
| | | lock(); |
| | |
| | | handler.shutdown(); |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | finally |
| | | { |
| | | release(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Unregister this handler from the list of handlers registered to this |
| | |
| | | "In " + this + |
| | | " Receiving ResetGenerationIdMsg from " + senderHandler.getServerId() + |
| | | " for baseDn " + baseDn + ":\n" + genIdMsg); |
| | | |
| | | try |
| | | { |
| | | try |
| | | { |
| | | // Acquire lock on domain (see more details in comment of start() method |
| | |
| | | Long.toString(newGenId)); |
| | | logError(message); |
| | | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | finally |
| | | { |
| | | release(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Process message of a remote server changing his status. |
| | |
| | | |
| | | try |
| | | { |
| | | try |
| | | { |
| | | // Acquire lock on domain (see more details in comment of start() method |
| | | // of ServerHandler) |
| | | lock(); |
| | |
| | | { |
| | | // Already logged an error in processNewStatus() |
| | | // just return not to forward a bad status to topology |
| | | release(); |
| | | return; |
| | | } |
| | | |
| | |
| | | newStatus.toString()); |
| | | logError(message); |
| | | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | finally |
| | | { |
| | | release(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Change the status of a directory server according to the event generated |
| | |
| | | { |
| | | try |
| | | { |
| | | try |
| | | { |
| | | // Acquire lock on domain (see more details in comment of start() method |
| | | // of ServerHandler) |
| | | lock(); |
| | |
| | | (newStatus == oldStatus) ) |
| | | { |
| | | // Change was impossible or already occurred (see StatusAnalyzer comments) |
| | | release(); |
| | | return false; |
| | | } |
| | | |
| | |
| | | buildAndSendTopoInfoToDSs(serverHandler); |
| | | buildAndSendTopoInfoToRSs(); |
| | | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | finally |
| | | { |
| | | release(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | |
| | | // Try doing job anyway... |
| | | } |
| | | |
| | | try |
| | | { |
| | | /* |
| | | * Store DS connected to remote RS and update information about the peer RS |
| | | * Store DS connected to remote RS & update information about the peer RS |
| | | */ |
| | | handler.processTopoInfoFromRS(topoMsg); |
| | | |
| | |
| | | */ |
| | | buildAndSendTopoInfoToDSs(null); |
| | | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | finally |
| | | { |
| | | release(); |
| | | } |
| | | } |
| | | |
| | | /* ======================= |
| | | * Monitor Data generation |
| | |
| | | // Consider this producer (DS/db). |
| | | int sid = db.getServerId(); |
| | | |
| | | // Should it be considered for eligibility ? |
| | | ChangeNumber heartbeatLastDN = |
| | | getChangeTimeHeartbeatState().getMaxChangeNumber(sid); |
| | | |
| | | // If the most recent UpdateMsg or CLHeartbeatMsg received is very old |
| | | // then the domain is considered down and not considered for eligibility |
| | | /* |
| | | if ((heartbeatLastDN != null) && |
| | | (TimeThread.getTime()- heartbeatLastDN.getTime() > 5000)) |
| | | { |
| | | if (debugEnabled()) |
| | | TRACER.debugInfo("In " + this.getName() + |
| | | " Server " + sid |
| | | + " is not considered for eligibility ... potentially down"); |
| | | continue; |
| | | } |
| | | */ |
| | | |
| | | boolean sidConnected = false; |
| | | if (directoryServers.containsKey(sid)) |
| | | { |
| | | sidConnected = true; |
| | | } |
| | | else |
| | | { |
| | | // not directly connected |
| | | for (ReplicationServerHandler rsh : replicationServers.values()) |
| | | { |
| | | if (rsh.isRemoteLDAPServer(sid)) |
| | | { |
| | | sidConnected = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (!sidConnected) |
| | | { |
| | | if (debugEnabled()) |
| | | TRACER.debugInfo("In " + this.getName() + |
| | | " Server " + sid |
| | | + " is not considered for eligibility ... potentially down"); |
| | | continue; |
| | | } |
| | | |
| | | ChangeNumber changelogLastCN = db.getLastChange(); |
| | | if (changelogLastCN != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | ChangeNumber heartbeatLastDN = |
| | | getChangeTimeHeartbeatState().getMaxChangeNumber(sid); |
| | | |
| | | if ((heartbeatLastDN != null) && |
| | | ((eligibleCN == null) || (heartbeatLastDN.newer(eligibleCN)))) |
| | | { |