[18.0][OU-FIX] base: make the legacy module-state snapshot resume-friendly#10
Open
eantones wants to merge 2 commits into
Open
[18.0][OU-FIX] base: make the legacy module-state snapshot resume-friendly#10eantones wants to merge 2 commits into
eantones wants to merge 2 commits into
Conversation
The 18.0.1.3 pre-migration CREATEs the legacy ir_module_module snapshot table unguarded. When a run crashes after this script's transaction was committed but before base's version bump (e.g. an external-dependency UserError at button_upgrade), the standard restart-and-resume re-runs the script and dies on DuplicateTable. Use CREATE TABLE IF NOT EXISTS so the resume keeps the first capture — which is the correct pre-upgrade snapshot: recapturing at that point would record module states with the renames/merges below already applied. The rest of the script is already re-run tolerant (update_module_names no-ops on absent old names).
Second statement of the same resume scenario: copy_columns ADDs the legacy ir_act_window_view.view_mode column unguarded, so a resumed run that already committed it dies on DuplicateColumn. Skip the copy when the legacy column already exists — its content from the first attempt is the correct pre-upgrade capture. The remaining statements of this script are already re-run tolerant (WHERE-guarded UPDATEs and no-op renames).
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.
The 18.0.1.3 pre-migration CREATEs the legacy ir_module_module snapshot table unguarded. When a run crashes after this script's transaction was committed but before base's version bump (e.g. an external-dependency UserError at button_upgrade), the standard restart-and-resume re-runs the script and dies on DuplicateTable.
CREATE TABLE IF NOT EXISTS keeps the first capture on resume — which is the correct pre-upgrade snapshot: recapturing at that point would record module states with the renames/merges already applied. The rest of the script is already re-run tolerant (update_module_names no-ops on absent old names).
Hit on a real 17→18 resume (crash #1 was an unrelated missing python dep at button_upgrade). Upstreamable as-is.