fixed issue #440 , optime find position

This commit is contained in:
agapple
2017-12-10 22:24:24 +08:00
parent 5aed505429
commit c60b04424b
2 changed files with 72 additions and 23 deletions

View File

@@ -771,6 +771,14 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
}
}
if (entryPosition == null) {
// 如果啥都找不到,就返回第一条Format Event的位点,一般是116位点
entryPosition = new EntryPosition(logfilename, logfileoffset, logposTimestamp, serverId);
logger.debug("set {} to be pending start position before finding another proper one...",
entryPosition);
logPosition.setPostion(entryPosition);
}
if (StringUtils.equals(endPosition.getJournalName(), logfilename)
&& endPosition.getPosition() < logfileoffset) {
return false;