Commit f0890d93 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type: add a transaction note when bootstraping

Bootstrap is actually the automatic migration of tools. It happened to me
several times that I mistakenly start an old instance on a too new version of
products and this instance is migrated automatically.

By leaving a note in transaction it's easier to find out which
transaction performed the automatic migration to revert to the state
before using technique such as
https://blog.gocept.com/2019/06/14/undo-transactions-by-truncating-zodb-data-fs/
for FileStorage.

with this change, a command such as;

    python -m ZODB.scripts.fstail -n 20 ./instance/slappart6/srv/zodb/root.fs

show something like:

    2019-11-12 02:46:42.106313: hash=44fecb9a63411fbf305cea82f4c699c478000d61
    user=' None' description='/timer_service/process_timer\nSite migrated' length=462938 offset=881877846 (+70)

for the transaction which did the migration, so it's easy to repair.

/reviewed-on !975
parent 4f46e3ef
...@@ -462,6 +462,7 @@ def synchronizeDynamicModules(context, force=False): ...@@ -462,6 +462,7 @@ def synchronizeDynamicModules(context, force=False):
portal.portal_skins.changeSkin(None) portal.portal_skins.changeSkin(None)
TransactionalResource(tpc_finish=lambda txn: TransactionalResource(tpc_finish=lambda txn:
_bootstrapped.add(portal.id)) _bootstrapped.add(portal.id))
transaction.get().note('Site migrated')
LOG('ERP5Site', INFO, 'Transition successful, please update your' LOG('ERP5Site', INFO, 'Transition successful, please update your'
' business templates') ' business templates')
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment