I finally upgraded my Nextcloud server, using nanogallery2 instead of relying on the new brand Photos app, since it does not provide a simple way to share a gallery and is clearly not about to be resolved (the developers that in first place considered there was no problem to fix finally said that people were too harsh try to convince them otherwise so they finally lost interest in fixing it). Well, in any case, using static files for this purpose is much more efficient.
During the upgrade, I hit issue with the oc_flow_operations table that is mentioned in numerous reports (the whole first page of google search).
I first fixed it by, as suggested by some users, adding a missing column. That allowed to finish the upgrade but something was still off, with the logfile growing to a few MB every minutes.
Finally, recreating the whole table fixed it for me:
cat /etc/mysql/debian.cnf | grep password mysql -udebian-sys-maint -p
connect nextcloud; DROP table oc_flow_operations ; CREATE table oc_flow_operations (id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, class varchar(256), name varchar(256) NOT NULL, checks longtext, operation longtext,entity varchar(256),events longtext);
su www-data -s /bin/bash php occ maintenance:repair