Can I subscribe to the CDC data of a specific table, and can this table be subscribed to by multiple tasks or only one task?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 我想订阅某一张表的cdc数据,该表可以被多个任务订阅吗?还是只能被一个任务订阅

| username: 迷人的Ti

[Test Environment for TiDB] Testing
[TiDB Version] 5.4.3
[Reproduction Path] Using the TiKV client in Java, it is possible to subscribe to the same table in multiple tasks. During processing, data loss was discovered. Is it not possible for the same table to be subscribed to CDC data by multiple tasks?
[Encountered Problem: Problem Phenomenon and Impact]
Using the TiKV client in Java, it is possible to subscribe to the same table in multiple tasks. During processing, data loss was discovered. Is it not possible for the same table to be subscribed to CDC data by multiple tasks?
[Resource Configuration]
As a newbie, I would like to thank all the experts here in advance for helping to answer this question. Thank you!
[Attachment: Screenshot/Log/Monitoring]

| username: ti-tiger | Original post link

It is possible to subscribe to data changes of the same table in multiple tasks, but it is necessary to ensure that each task can correctly handle change events without duplication or omission. Some logic needs to be implemented in the Consumer object, such as using distributed locks, deduplication caches, idempotent operations, etc. If Region information changes due to Region splitting or Region migration, the requested Region information will become outdated, and the tikv-server will return a Region error. In this case, it is necessary to retrieve the latest Region information and resend the request.

| username: Fly-bird | Original post link

It can be multiple

| username: TiDBer_小阿飞 | Original post link

This should be the correct analysis.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.