Skip to content

Conversation

@hanlinking
Copy link

Purpose of this pull request

修复使用 sqlserver-cdc 的earliest启动模式下出现数组下标溢出问题。原因是初始化的偏移值错误(INITIAL_OFFSET)。
原代码是用了一个字节表示,启动器时
image这个代码为抛出ArrayIndexOutOfBoundsException异常
image
原因是对比代码这里按数组对比。比如当前 sqlsqserver cdc 的 lsn 是0x000233BA00000930016E,共 10 个字节,而用于比对的初始 lsn 只有 1 个字节,并且首个字节相同,对比到第二个字节时获取目标字节下标溢出了。
于是现在修改INITIAL_OFFSET也为 10 个字节,从而解决这个问题

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@davidzollo
Copy link
Contributor

Good job
Please add related LsnOffsetTest for this PR.

By the way, CI failed now, please check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants