Skip to content

Commit 6d8dd07

Browse files
committed
1. Fix compressed OSS binlog data
2. Fix first second data loss caused by dumping from OSS binlog
1 parent af93754 commit 6d8dd07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinLogConnection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void dump(String binlogfilename, Long binlogPosition, SinkFunction func)
118118
if (!iterateEvents.isEmpty()) {
119119
// 处理compress event
120120
for(LogEvent itEvent : iterateEvents) {
121-
if (!func.sink(event)) {
121+
if (!func.sink(itEvent)) {
122122
needContinue = false;
123123
break;
124124
}
@@ -210,7 +210,8 @@ public void dump(long timestampMills, SinkFunction func) throws IOException {
210210
if (event != null) {
211211
checkServerId(event);
212212

213-
if (event.getWhen() > timestampSeconds) {
213+
// 闭区间,防止丢开始那一秒的数据
214+
if (event.getWhen() >= timestampSeconds) {
214215
break;
215216
}
216217

0 commit comments

Comments
 (0)