fix: buildLastTransactionPosition 的 for 循环少了 =0

This commit is contained in:
littleneko
2018-11-07 20:24:38 +08:00
committed by GitHub
parent 8f2e2b9ccd
commit 2278340c7b

View File

@@ -417,7 +417,7 @@ public abstract class AbstractEventParser<EVENT> extends AbstractCanalLifeCycle
}
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);
if (entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONEND) {// 尽量记录一个事务做为position
return buildLastPosition(entry);