if ( producerScn < startScn)
{
String msg = "Bootstrap Producer has lower SCN than Applier SCN. This is unexpected !! Producer SCN :" + producerScn + ", Applier SCN :" + startScn;
LOG.fatal(msg);
throw new BootstrapDatabaseTooOldException(msg);
}
if (producerScn < sinceScn)
{ // bootstrap producer needs sometime to consumer events in the buffer, wait a bit.
LOG.warn("Bootstrap producer has not caught up to all events in its buffer yet to server client properly");
Thread.sleep(QUERY_WAIT_TIME_SLICE);
}
}
catch (InterruptedException e)
{
// keeps on sleeping until timed out
}
catch (SQLException e)
{
LOG.warn("SQLException encountered while querying for start scn", e);
}
finally
{
DBHelper.close(rs,getScnStmt, null);
}
}
// Slow Producer case
if ( producerScn < sinceScn)
{
String msg = "Bootstrap producer is slower than the client. Client is at SCN :" + sinceScn
+ ", Producer is at SCN :" + producerScn + ", Applier is at SCN :" + startScn;
LOG.error(msg);
throw new BootstrapDatabaseTooOldException(msg);
}
LOG.info("StartSCN Request for sources :" + sources + ",Client SCN :" + sinceScn + ",Producer SCN :" + producerScn + ", Applier SCN :" + startScn);
return startScn;
}