From 49f2c6f7165ea94640716230c610a154a7f502d5 Mon Sep 17 00:00:00 2001
From: mrossign <mrossign@localhost>
Date: Thu, 02 Apr 2009 09:44:38 +0000
Subject: [PATCH] Fix for 2963: dsreplication status large value for missing changes dsreplication status sometimes returns very unexpected high values. This is due to the fact that the replication server monitoring algorithm sometimes does not compute well the max server state available in the whole topology and thus is sometimes calling ChangeNumber.diffSeqNum(CN1,CN2) with a CN1 lower than CN2.
---
opends/src/server/org/opends/server/replication/server/MonitorData.java | 37 +++++++++++++++++++++++++++++++++----
1 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/MonitorData.java b/opends/src/server/org/opends/server/replication/server/MonitorData.java
index 81a1473..0c96b2e 100644
--- a/opends/src/server/org/opends/server/replication/server/MonitorData.java
+++ b/opends/src/server/org/opends/server/replication/server/MonitorData.java
@@ -185,6 +185,24 @@
"+ diff("+lsjMaxCN+"-"
+lsiLastCN+")="+missingChangesLsiLsj;
+ // Regarding a DS that is generating changes. If it is a local DS1,
+ // we get its server state, store it, then retrieve server states of
+ // remote DSs. When a remote server state is coming, it may contain
+ // a change number for DS1 which is newer than the one we locally
+ // stored in the server state of DS1. To prevent seeing DS1 has
+ // missing changes whereas it is wrong, we replace the value with 0
+ // if it is a low value. We cannot overwrite big values as they may be
+ // useful for a local server retrieving changes it generated earlier,
+ // when it is recovering from an old snapshot and the local RS is
+ // sending him the changes it is missing.
+ if (lsjSid.equals(lsiSid)) {
+ if (missingChangesLsiLsj <= 50)
+ {
+ missingChangesLsiLsj = 0;
+ mds += " (diff replaced by 0 as for server id " + lsiSid + ")";
+ }
+ }
+
lsiMissingChanges += missingChangesLsiLsj;
}
}
@@ -226,7 +244,7 @@
"Complete monitor data : Missing changes ("+ lsiSid +")=" + mds);
}
this.setBuildDate(TimeThread.getTime());
- }
+ }
/**
* Returns a <code>String</code> object representing this
@@ -243,7 +261,7 @@
while (rsite.hasNext())
{
Short sid = rsite.next();
- mds += "\nRSData(" + sid + ")=\t "+ "afmd=" + fmRSDate.get(sid);
+ mds += "\nfmRSDate(" + sid + ")=\t "+ "afmd=" + fmRSDate.get(sid);
}
// maxCNs
@@ -252,7 +270,7 @@
{
Short sid = itc.next();
ChangeNumber cn = maxCNs.get(sid);
- mds += "\nmaxCNs(" + sid + ")= " + cn.toString();
+ mds += "\nmaxCNs(" + sid + ")= " + cn.toStringUI();
}
// LDAP data
@@ -269,8 +287,19 @@
}
mds +=" missingCount=" + missingChanges.get(sid);
}
+
+ // RS data
+ rsite = RSStates.keySet().iterator();
+ while (rsite.hasNext())
+ {
+ Short sid = rsite.next();
+ ServerState ss = RSStates.get(sid);
+ mds += "\nRSData(" + sid + ")=\t" + "state=[" + ss.toString()
+ + "] missingCount=" + missingChangesRS.get(sid);
+ }
+
//
- mds += "--";
+ mds += "\n--";
return mds;
}
--
Gitblit v1.10.0