问题: 执行 deploy-mining.sh full-reset 后,identity-postgres-connector 等 1.0 source CDC connectors 保留了旧的 Debezium offset 和 replication slot,导致 Debezium 认为 initial snapshot 已完成而跳过重新快照。如果 connector 的 JSON 配置文件中 新增了表(如 identity-connector.json 中的 wallet_addresses),这些表的存量数据 永远不会被捕获到 Kafka topic,2.0 服务无法通过 CDC 同步到这些数据。 具体表现:Kafka topic cdc.identity.public.wallet_addresses 始终为空(0条消息), 2.0 auth-service 的 synced_wallet_addresses 表为空,用户 KAVA 地址未同步。 修复: 在 full_reset() 的 Step 4 中,除了处理 outbox connectors,还新增了对 1.0 source CDC connectors (identity/referral/planting) 的处理: 1. 删除 connector(释放 replication slot) 2. 发送 tombstone 清除 debezium_offsets topic 中的偏移量 3. 调用 pg_drop_replication_slot() 删除 PostgreSQL replication slot 新增 Step 9:从 scripts/debezium/*.json 配置文件重新注册 source connectors, 因为 offset 和 slot 都已清除,snapshot.mode=initial 会触发全新的 initial snapshot, 确保所有配置表(包括新增的 wallet_addresses)的存量数据都被灌入 Kafka topic。 总步骤数从 18 调整为 19。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude | ||
| api-gateway | ||
| infrastructure | ||
| mpc-system | ||
| scripts | ||
| services | ||
| .env.windows | ||
| docker-compose.windows.yml | ||