Nothing changed; always get connection timeout on alter table in MariaDB
Which version of MariaDB are you upgrading from? It could be that there has been a table or index format change between the versions. Or it could be that the newer version is using the ONLINE alter table and the previous version was not, resulting in the newer version using more of a particular resource. What's the server doing during the time before the timeout? (swapping, writing to disk, etc)

You can try executing the command with the '--old-alter-table' argument.

If you still don't have any luck, the first thing I would try is to rebuild the table. Dump it (good to have a backup in this situation anyway) into an sql file and then reload it into a table with a new, different name. If all goes well drop the old one and rename the new one. Now try the alter statement again.