Repository navigation
Filter stale link provider intents during a deploy - #2823
Conversation
When a deploy removes a provided link, the link stays in records.json and in the .bosh/links.json file of the job until the next deploy. The stale link group keeps the BOSH DNS link alias for the removed link alive. The cause is the order of the deploy steps. The links parser gives each intent in the manifest the current links_serial_id. The deploy deletes the unused providers in the cleanup step, after the update stage. Planner#link_provider_intents did not filter by serial_id. Thus the update stage rendered the DNS links and links.json from intents that the manifest no longer has. The consumer path already filters by serial_id in LinksManager. The provider path got the unfiltered list in 5297d5c, when links.json and the link groups in records.json were added. The fix filters the intents by links_serial_id only for a deploy action. A deploy action always runs the links parser, so each current intent has the current serial_id. Other actions, such as cck and recreate, do not run the parser. If a deploy fails after it increments the serial and before it parses the links, no intent has the new serial. A filter on these actions would then give empty DNS links and an empty links.json. Alternatives ruled out: - Call remove_unused_links before the update stage. That method deletes each consumer link that has no InstancesLink at the current serial. The update stage sets these serials, so an early call deletes nearly all consumer links, and a failed deploy cannot restore them. - Filter for all actions. This fails as described above for cck and recreate after a failed deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughFor deploy actions, Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
TNZ-164428 reports a restart of cloud_controller_ng on an Apply Changes with no manifest change. The release removed a link. The deploy with the new release still rendered the old link in .bosh/links.json. Cleanup then removed the link metadata, so the next deploy rendered different templates and restarted the job. Commit b40d089 fixes this. It filters the stale provider intents during a deploy. The spec now covers the two paths to a removed link: - A manifest removes custom_provider_definitions. - A new release version removes a provides entry from the job spec. This is the TNZ-164428 case. After the removal deploy, each example deploys again with no change. The output must not contain "Updating instance mysql". Without b40d089, both examples fail at the links.json check. The removed link stays in links.json until the next deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e20f6f3 to
84cc1af
Compare
|
Thank you for your contribution! |
What is this change about?
When a deploy removes a provided link, the link stays in
records.jsonand in the.bosh/links.jsonfile of the job. It goes away only on the next deploy. Until then, the stale link group keeps the BOSH DNS link alias for the removed link alive.The next deploy then renders a
links.jsonwithout the link. The templates change, so the job restarts with no manifest change. For example,cloud_controller_ngrestarted on an Apply Changes after a release removed a link.The cause is the order of the deploy steps:
links_serial_id.linksandlinks.jsonfromPlanner#link_provider_intents. That method did not filter byserial_id.cleanupstep, after the update stage.The consumer path already filters by
serial_idinLinksManager. The provider path got the unfiltered list in 5297d5c, whenlinks.jsonand the link groups inrecords.jsonwere added.The fix filters the intents by
links_serial_idonly for a deploy action. A deploy action always runs the links parser, so each current intent has the current serial.Other actions, such as
cckandrecreate, do not run the parser. A deploy can fail after it increments the serial and before it parses the links. Then no intent has the new serial. A filter on those actions would give empty DNS links and an emptylinks.json.Alternatives ruled out:
remove_unused_linksbefore the update stage. That method deletes each consumer link that has noInstancesLinkat the current serial. The update stage sets those serials. An early call deletes nearly all consumer links, and a failed deploy cannot restore them.cckandrecreateafter a failed deploy, as described above.Please provide contextual information.
[bosh-dns] add metadata about link based dns names). Related: 3974876, 4675288.What tests have you run against this PR?
planner_spec.rb: 34 examples, 0 failures. Without the fix, the new deploy-action example fails.update_deployment_spec,deployment_plan/,links/,errand/,cloudcheck_helper_spec): 1775 examples, 0 failures.spec/integration/links/removed_link_provider_spec.rb, with 2 examples. One example removescustom_provider_definitionsfrom the manifest. The other uploads a release version that no longer provides the link. After the removal deploy, each example deploys again with no change. The output must not containUpdating instance mysql..bosh/links.jsonstill has the link:expected ["my-custom-link", "db"] not to include ....How should this change be described in bosh release notes?
When a deploy removes a provided link, the Director now removes the link from the BOSH DNS records and from
.bosh/links.jsonin the same deploy. The next deploy no longer restarts the job.Does this PR introduce a breaking change?
No.
Tag your pair, your PM, and/or team!
AI Review Feedback
🤖 Generated with Claude Code