aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/test/release_handler_SUITE_data
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-09-08 10:14:10 +0200
committerSiri Hansen <[email protected]>2011-11-17 16:47:27 +0100
commit19a46c5c9f4ed3f0f2bfb149fc1feb0b93d55379 (patch)
tree723e9e36d1e1078b244cc5698b7a8c54c8222c88 /lib/sasl/test/release_handler_SUITE_data
parent5dc64cffb084e8abc6e5908025833481331f38de (diff)
downloadotp-19a46c5c9f4ed3f0f2bfb149fc1feb0b93d55379.tar.gz
otp-19a46c5c9f4ed3f0f2bfb149fc1feb0b93d55379.tar.bz2
otp-19a46c5c9f4ed3f0f2bfb149fc1feb0b93d55379.zip
Restart emulator before running upgrade script when erts is upgraded
If the version of erts differs between two releases, the release handler automatically adds a 'restart_new_emulator' instruction to the upgrade script (relup). Earlier, this instruction was always added at the end of the upgrade script, causing the following sequence of operations during an upgrade (a bit simplified): 1. suspend processes 2. load new code 3. execute code_change functions 4. resume processes 5. restart emulator with new erts version Obviously, this caused the new code to be loaded into the old emulator and this would fail if the beam format had been changed in the new version of the emulator. To overcome this problem, this commit changes the order of the instructions, so for upgrade with changed erts version we now have: 1. restart emulator with new erts, kernel, stdlib and sasl versions, but old versions of all other applications. 2. suspend processes 3. load new code 4. execute code_change functions 5. resume processes This is implemented by creating a temporary release, including new erts, kernel, stdlib and sasl from the new release and all other applications from the old release. A new boot file for this temporary release is created, which includes a new 'apply' instruction to run release_handler:new_emulator_upgrade/2. Then the emulator is restarted using this boot file - and release_handler:new_emulator_upgrade/2 executes the rest of the upgrade script. For downgrade, the order will be as before: 1. suspend processes 2. execute code_change functions with 'down'-indication 3. load old code 4. resume processes 5. restart emulator with old erts version
Diffstat (limited to 'lib/sasl/test/release_handler_SUITE_data')
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.appup2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/src/a.erl4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.appup b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.appup
index 05db4cb541..6ef67b869e 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.appup
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.appup
@@ -1,3 +1,3 @@
{"1.1",
[{"1.0",[{update,a,{advanced,extra_par}}]}],
- []}.
+ [{"1.0",[{update,a,{advanced,extra_par}}]}]}.
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/src/a.erl b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/src/a.erl
index c082ad5339..1050e53f35 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/src/a.erl
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/src/a.erl
@@ -51,4 +51,6 @@ terminate(_Reason, _State) ->
ok.
code_change(1, Extra, State) ->
- {ok, {state, bval}}.
+ {ok, {state, bval}};
+code_change({down,1},Extra,State) ->
+ {ok, state}.