Skip to content

Commit

Permalink
[nix] upgrade mariadb from 10.8 to 10.11
Browse files Browse the repository at this point in the history
Summary:
The modification of the flake.nix file is just removing the mariadb v.10.8 overlay, automatically bumping us to v.10.11.

The mariadb-up script is also modified to check whether or not an upgrade is necessary. If required, it will run `mariadb-upgrade`.

For a dev currently on 10.8, after this is landed, the dev will
1. pull the commit
2. exit their terminals and any `nix develop` sessions
3. pkill mariadb` if there is a running server process (`ps aux | grep mariadb`)
4. nix develop

On this nix develop, it should identify an upgrade is required and print out upgrade progress

After this step, everything should be upgraded

Depends on D12021

Test Plan:
- Set up dev environment with a mariadb 10.8 versioned table
- Launched an iOS simulator and exchanged messages between test users on a test community
- Ran through the above upgrade steps
- On a new iOS simulator, ensured that the messages were persisted from before and that new communities and users could be registered and exchange messages

Reviewers: ashoat, O1 Nix

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D12022
  • Loading branch information
wyilio committed May 14, 2024
1 parent 5082432 commit 57b16fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
(_: _: {
emscripten = oldNixpkgs.emscripten; # Changed signficantly
php80 = oldNixpkgs.php80; # Used for arcanist
mariadb = oldNixpkgs.mariadb_108;
})
];
};
Expand Down
13 changes: 13 additions & 0 deletions nix/mariadb-up-mac.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ in writeShellApplication {
"${gnused}/bin/sed" -i -e "s|PASS|$PASS|g" "$KEYSERVER_DB_CONFIG"
fi
# check if MariaDB requires an upgrade
"${lib.getBin mariadb}/bin/mariadb-upgrade" -u "$USER" \
--socket="$MYSQL_UNIX_PORT" \
--check-if-upgrade-is-needed >/dev/null 2>&1
exit_code=$?
if [[ $exit_code -eq 0 ]]; then
"${lib.getBin mariadb}/bin/mariadb-upgrade" -u "$USER" \
--socket="$MYSQL_UNIX_PORT" \
echo "Upgrade complete" >&2
fi
# Explicitly exit this script so the parent shell can determine
# when it's safe to return control of terminal to user
exit 0
Expand Down

0 comments on commit 57b16fd

Please sign in to comment.