Permalink
Browse files

adding stopOnError handling to PublishtableInfo and fixing a bug wher…

…e primary keys wouldn't be published after recovering from failed tableinfo publishing
  • Loading branch information...
1 parent f3f7300 commit d6e68c1282eca48486b31b36e73038d11fda3ca2 @ssandler ssandler committed Feb 4, 2013
Showing with 8 additions and 3 deletions.
  1. +5 −1 TeslaSQL/Agents/Agent.cs
  2. +3 −2 TeslaSQL/Agents/Master.cs
View
6 TeslaSQL/Agents/Agent.cs
@@ -101,7 +101,11 @@ public abstract class Agent {
destDataUtils.CreateTableInfoTable(relayDB, CTID);
foreach (var t in tableConf) {
logger.Log(new { message = "Publishing info", Table = t.Name }, LogLevel.Trace);
- destDataUtils.PublishTableInfo(relayDB, t, CTID, changesCaptured[t.FullName]);
+ try {
+ destDataUtils.PublishTableInfo(relayDB, t, CTID, changesCaptured[t.FullName]);
+ } catch (Exception e) {
+ HandleException(e, t, "Error publishing TableInfo for table " + t.SchemaName + "." + t.Name + ": " + e.Message + " - Stack Trace:" + e.StackTrace);
+ }
}
}
}
View
5 TeslaSQL/Agents/Master.cs
@@ -65,10 +65,11 @@ public Master(IDataUtils sourceDataUtils, IDataUtils destDataUtils, Logger logge
logger.Log("Working on CTID " + ctb.CTID, LogLevel.Info);
IDictionary<string, Int64> changesCaptured;
+ logger.Log("Calculating field lists for configured tables", LogLevel.Info);
+ SetFieldLists(Config.MasterDB, Config.Tables, sourceDataUtils);
+
//capture changes/publish schema changes is now one unit, so we can just check either.
if ((ctb.SyncBitWise & Convert.ToInt32(SyncBitWise.CaptureChanges)) == 0) {
- logger.Log("Calculating field lists for configured tables", LogLevel.Info);
- SetFieldLists(Config.MasterDB, Config.Tables, sourceDataUtils);
changesCaptured = CaptureChanges(currentVersion);
PublishSchemaChanges();
destDataUtils.WriteBitWise(Config.RelayDB, ctb.CTID, Convert.ToInt32(SyncBitWise.PublishSchemaChanges), AgentType.Master);

0 comments on commit d6e68c1

Please sign in to comment.