ruanhang1993 commented on code in PR #3924:
URL: https://github.com/apache/flink-cdc/pull/3924#discussion_r2032529462


##########
docs/content.zh/docs/connectors/flink-sources/mysql-cdc.md:
##########
@@ -787,6 +798,31 @@ $ ./bin/flink run \
 * 如果指定的列不存在更新操作,此时可以保证 Exactly once 语义。
 * 如果指定的列存在更新操作,此时只能保证 At least once 语义。但可以结合下游,通过指定下游主键,结合幂等性操作来保证数据的正确性。
 
+#### 警告
+
+在 MySQL 表中,若使用 **非主键列** 作为 
`scan.incremental.snapshot.chunk.key-column`,可能导致**数据不一致**。以下为可能出现的问题及其缓解方案。

Review Comment:
   ```suggestion
   在 MySQL 表中,若使用 **非主键列** 作为有主键表的 
`scan.incremental.snapshot.chunk.key-column`,可能导致**数据不一致**。以下为可能出现的问题及其缓解方案。
   ```



##########
docs/content.zh/docs/connectors/flink-sources/mysql-cdc.md:
##########
@@ -787,6 +798,31 @@ $ ./bin/flink run \
 * 如果指定的列不存在更新操作,此时可以保证 Exactly once 语义。
 * 如果指定的列存在更新操作,此时只能保证 At least once 语义。但可以结合下游,通过指定下游主键,结合幂等性操作来保证数据的正确性。
 
+#### 警告
+
+在 MySQL 表中,若使用 **非主键列** 作为 
`scan.incremental.snapshot.chunk.key-column`,可能导致**数据不一致**。以下为可能出现的问题及其缓解方案。
+
+#### 问题场景
+
+- **表结构:**
+   - **主键:** `id`
+   - **分片键列 :** `pid`(非主键)
+
+- **快照分片 :**
+   - **分片 0:** `1 < pid <= 3`
+   - **分片 1:** `3 < pid <= 5`
+
+- **操作 :**
+   - 两个子任务并行读取 **分片 0** 和 **分片 1**。
+   - 在读取过程中,发生了一次 **更新** 操作,使 `id=0` 的 `pid` 从 `2` 变为 `4`,而此时两个分片的**高低水位**均包含 
`pid=3`,导致该更新操作跨越两个分片。

Review Comment:
   ```suggestion
      - 在读取过程中,发生了一次 **更新** 操作,使 `id=0` 的 `pid` 从 `2` 变为 
`4`,在两个分片的**高低水位**间都包含此次变更,导致该更新操作在增量阶段不会被处理。
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to