|
@@ -417,7 +417,7 @@ public abstract class AbstractEventParser<EVENT> extends AbstractCanalLifeCycle
|
|
}
|
|
}
|
|
|
|
|
|
protected LogPosition buildLastTransactionPosition(List<CanalEntry.Entry> entries) { // 初始化一下
|
|
protected LogPosition buildLastTransactionPosition(List<CanalEntry.Entry> entries) { // 初始化一下
|
|
- for (int i = entries.size() - 1; i > 0; i--) {
|
|
|
|
|
|
+ for (int i = entries.size() - 1; i >= 0; i--) {
|
|
CanalEntry.Entry entry = entries.get(i);
|
|
CanalEntry.Entry entry = entries.get(i);
|
|
if (entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONEND) {// 尽量记录一个事务做为position
|
|
if (entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONEND) {// 尽量记录一个事务做为position
|
|
return buildLastPosition(entry);
|
|
return buildLastPosition(entry);
|