rwadurian/backend
hailin 5b1f4c82e6 fix(deploy): full-reset 时重建 1.0 source CDC connectors 以确保完整数据同步
问题:
  执行 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>
2026-01-31 20:26:06 -08:00
..
.claude refactor: simplify mpc-service to gateway mode 2025-12-06 17:16:14 -08:00
api-gateway feat(api-gateway): 添加 mining-admin-upgrade 路由支持股行App版本管理 2026-01-29 12:37:39 -08:00
infrastructure chore(docker): 为 mpc-system、api-gateway、infrastructure 添加时区配置 2025-12-23 18:35:09 -08:00
mpc-system fix(service-party-android): 导出钱包时自动从后端获取空的 partyId 2026-01-29 07:00:01 -08:00
scripts fix(scripts): 修正容器名为 rwa-blockchain-service 2025-12-15 10:34:25 -08:00
services fix(deploy): full-reset 时重建 1.0 source CDC connectors 以确保完整数据同步 2026-01-31 20:26:06 -08:00
.env.windows fix(referral): 修复 getMyReferralInfo 使用 userId 而不是 accountSequence 的问题 2025-12-14 05:05:03 -08:00
docker-compose.windows.yml fix(mining-service): Redis DB 11 冲突修复,迁移至 DB 16 2026-01-30 02:22:20 -08:00