Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: TAP-12456
Repo: tapdata-connectors
Target branch: develop
AI coding summary:
TAP-12456 实现总结
实现与评审一致性
Codexcli 的实现与两轮评审结论高度一致:主战场在
postgres-core的 physical WAL 解码链路,覆盖了 enum 标量与 enum 数组两类,目标端 MSSQL 无需改动。具体对应关系:RelationCatalogjoinpg_type加载pg_enum映射PgTypeDecoder.decode()按 OID 查映射输出标签字符串decodeArray()废弃>10000启发式、按定长 4 字节读 enum 元素PhysicalWalLogMiner共用类型解析ALTER TYPE ... ADD VALUE缓存刷新文件变更清单
ColumnInfo.java— 增加 enum 标签映射字段RelationCatalog.java— 列加载 SQL joinpg_type/pg_enum,构建 OID→label 映射HeapTupleDecoder.java— 将 enum 映射传递到解码链路PgTypeDecoder.java— 标量 enum 按 4 字节 OID 转标签;enum 数组元素按定长 4 字节读取并转标签PhysicalWalLogMiner.java— DDL 分支共用类型解析PgTypeDecoderTest.java/RelationCatalogTest.java— 新增对应单元测试测试结果
mvn -pl connectors-common/postgres-core -Dtest=PgTypeDecoderTest,HeapTupleDecoderTest,RelationCatalogTest test✅mvn -pl connectors-common/postgres-core -Dtest='io.tapdata.connector.postgres.cdc.physical.*Test' test✅残余风险
[WAL-DEBUG]、抓字节流对比解码结果ALTER TYPE ... ADD VALUE场景未验证 — 当前依赖 catalog invalidation 清缓存,但未专门监听 pg_enum WAL 变更,新增枚举值可能在缓存刷新前解析失败PgTypeDecoder兜底分支结论
实现正确覆盖了核心问题(PG enum/enum array 在 physical WAL 增量阶段的乱码),变更范围精准、测试通过。上述残余风险不影响主流程功能,但建议在合并前补充一条集成测试用例以降低回归风险。
Pre-submit AI review: APPROVED by reasonix
APPROVED
TAP-12456 Pre-submit 代码评审(综合结论)
结论
实现正确覆盖了 Jira 描述的核心问题(PG enum / enum[] 在 physical 增量阶段的乱码),变更范围精准(仅
postgres-core的 physical 解码链路,目标端 mssql 未动,符合评审范围),全部 146 个单元测试通过(BUILD SUCCESS)。可以进入自动化测试。代码走查验证(逐路径核对)
标量 enum(如
status、mode):RelationCatalog.COLUMNSjoinpg_type,typtype='e'时加载pg_enumOID→label 映射 ✓HeapTupleDecoder定长分支(attlen=4)→PgTypeDecoder.decode()顶部 enum 分支 OID→label ✓enum 数组(如
drawMode、property):COLUMNS中LEFT JOIN pg_type et ON t.typelem = et.oid,解析元素 enum OID ✓decodeArray()废弃>10000启发式,元素按定长 4 字节读取后走标签映射 ✓DDL 变更路径:
applyPgAttributeChange→columnInfo()(带resolveEnumTypeOid)✓applyPendingChangesWithTypeInfo✓enumTypeCache随invalidate()一并清空 ✓非阻塞改进建议(不阻碍合入,建议后续跟进)
applyPendingChanges已成死代码:生产调用点已全部切换,仅RelationCatalogTest.java:162还在测试过期路径,建议删除并迁移测试。COLUMNS使用 INNER JOINpg_type:理论上不会漏行,但一旦意外发生将导致所有后续列静默错位。建议改LEFT JOIN防御性更好。PgTypeDecoder.java:157)。enum 路径已不再触发,但其它自定义类型仍会静默产错,建议至少补一条 WARN。drawMode/property可能为空数组,验收时建议覆盖。[WAL-DEBUG]抓字节流对比),尤其覆盖ALTER TYPE ... ADD VALUE后新标签解析。成员一致性
仅 Reasonix 一位成员参与本轮 pre-submit 评审,结论为 APPROVED,无分歧。
Automated test stage: not_required
No automated test was explicitly requested in the review comment.
Automated test required: no