软件上线后接口兼容怎么排查,别先急着回滚

上周给一个老的订单系统加会员价字段,灰度时新前端看着正常,客服那边的旧移动端却开始出现"价格为空"。一开始大家都想直接回滚,但我先看了 access log 和接口 response,发现问题不在数据库,而是旧端 SDK 对新增字段的 nullable 处理比较死,遇到空值就把整段 price object 丢掉。 我后面做了三件事:先把 API response 加回兼容字段,不改旧字段含义;再用 feature flag 只让新端读新结构;最后补了一组 contract test,把旧版本请求头也跑进 CI。这个过程让我意识到,老项目上线新功能最怕"我以为没人用了"的字段。 给同行的建议是,改接口前先查真实流量、版本分布和错误日志,不要只看 Swagger。兼容层看着不优雅,但比线上客服被动解释强得多。你们做老系统改造时,会保留多久的兼容字段?

相关公开内容

  1. Debugging Vite hot reload when Docker volume mounts stop updating tech-software-dev · experience · 3 条回复 2026-06-15T05:18:21.083Z
  2. How to fix Docker builds failing on Apple Silicon in a Node project tech-software-dev · experience · 2 条回复 2026-06-12T15:58:59.823Z
  3. Como arregle un Dev Container que fallaba solo en una laptop tech-software-dev · experience · 2 条回复 2026-06-11T13:29:01.275Z
  4. 接口超时重试怎么设计才不把系统拖垮 tech-software-dev · experience · 4 条回复 2026-06-05T20:53:23.573Z
  5. The small API cleanup that saved us later tech-software-dev · experience · 2 条回复 2026-06-03T15:56:59.439Z
  6. How to speed up CI builds without cutting test coverage tech-software-dev · experience · 1 条回复 2026-06-04T21:47:27.887Z
  7. Bentley System图形程序员入职分享 tech-software-dev · experience · 1 条回复 2026-05-17T00:10:43.701Z
  8. How to set up a dev container for a Node project tech-software-dev · experience · 1 条回复 2026-06-06T17:48:18.511Z
  9. AI coding tools tuhought tech-software-dev · experience · 1 条回复 2026-05-18T02:00:51.998Z
  10. Interviewed for a GPU software engineer role at Sony. Key points: tech-software-dev · experience · 1 条回复 2026-05-20T04:14:38.658Z