docs(guides): restructure the hot-upgrade guide and correct the runtime.exs rule - #304
Merged
Merged
Conversation
…me.exs rule The guide had grown by accretion: a heading level that started at h3 before any h2, a second h1 in the middle of the page, "Erlang/OTP is the runtime, not a library" repeated in three sections, two sections sharing the title "When a hot upgrade fails", and the capabilities section arriving after two sections that already assumed it. Reordered it to follow the decision a reader is making, from what can be hot-upgraded through when not to, how it works, how to prepare a project, how to check a release, how to apply one, and what happens when it fails. Each duplicated statement is now made once and referenced. Added the material the guide assumed rather than explained: * How a hot upgrade works: appup, relup and release_handler, the steps run over RPC, and why the boundary at install_release is what every failure message reports * Old and current code, purging, and why a hand written receive loop needs to re-enter through the module while an OTP behaviour does not * Adding or removing a process in the supervision tree, which the generated appup cannot express, with the apply instructions that do * Keeping the two versions compatible at their boundaries, native code, and going back, which is a full deployment rather than a hot downgrade * A glossary of the release statuses and the terms the log messages use Corrected the configuration rules. A changed runtime.exs was listed as a reason not to hot-upgrade, while the section below it said the change is applied, which is what the code does: the new version's file is resolved and applied through the relup hook during the install. It comes off the list, with the condition that matters stated instead, that the file is evaluated by the code the running node has loaded. Config providers stay on the list, since the provider modules do run in the old version. Verified against a running node rather than from reading: a monitored application was hot-upgraded between two versions whose runtime.exs, build time configuration and modules all differed. After the upgrade, with the same OS process and code_change having run, the application held the new version's runtime values, a key deleted in the new version was gone, and the value the new runtime.exs sets appears in no build time configuration, so it could only have come from that file. Risk assessment: Impact: documentation only. Readers of the hot-upgrade guide get a correct rule for runtime.exs and an explanation of the supervision tree case that previously was not covered anywhere. Blast radius: one guide file. No application code, configuration, test or workflow is touched, and the guide is published as an ExDoc extra, so the only build effect is the rendered page. Regression risk: low. Nothing executable changes. Heading levels and every internal anchor were checked after the reorder, and the one broken link in the file, which pointed at a repository that does not exist, now points at the right one. Rollback: plain commit revert.
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.
What changed
The hot-upgrade guide is restructured so it can be handed to someone who has never applied one, and the
runtime.exsrule is corrected.Structure. The page had a heading that started at
h3before anyh2, a secondh1in the middle, two sections sharing the title When a hot upgrade fails, and the capabilities section arriving after two sections that already assumed it. The same statement about Erlang/OTP being the runtime rather than a library appeared three times. It now follows the decision a reader is making: what can be hot-upgraded, when not to, how one works, how to prepare a project, how to check a release, how to apply one, what happens when it fails, and how to go back.New sections, all of which the guide previously assumed:
release_handler, the steps run over RPC, and why the boundary atinstall_release/2is what every failure message is really reportingreceiveloop has to re-enter through the module while an OTP behaviour does not{update, Module, supervisor}starts nothing and stops nothing, the generated appup cannot see a child specification insideinit/1, and theapplyinstructions that close the gapThe
runtime.exscorrectionThe guide listed a changed
runtime.exsas a reason not to hot-upgrade, three paragraphs above a bullet stating that the change is applied. The second one matches the implementation: the new version's file is resolved and applied through the relup hook during the install.It comes off the list. The condition that actually matters is stated instead - the file is evaluated by the code the running node has loaded, so it must not reach for something only the new release provides. Config providers stay on the list, since the provider modules genuinely do run in the old version.
This was verified against a running node, not inferred. A monitored application was hot-upgraded between two versions whose
runtime.exs, build time configuration and modules all differed:runtime.exsruntime.exs, deleted in the new oneSame OS process throughout,
code_change/3ran, andrelease_handler:which_releases/0afterwards showed the new versionpermanentand the previous oneold. The value the newruntime.exssets appears in no build time configuration, so the new file is the only place it could have come from.Risk assessment
runtime.exsand an explanation of the supervision tree case that was not covered anywhere before.Checklist
docs(scope): short descriptionFormatting and test checks were not run, as no Elixir source is touched by this change.
🤖 Generated with Claude Code (Claude Opus 5)