Skip to content

Commit

Permalink
In the E-Maj rollback processing, create a specific step to rollback …
Browse files Browse the repository at this point in the history
…all sequences at once. So the sequences rollback is now planned as other steps, with its duration estimate that can now take benefit from statistics issued by previous rollback operations. The real duration can be displayed by clients like Emaj_web.
  • Loading branch information
beaud76 committed Mar 24, 2023
1 parent 5364ada commit 207dd94
Show file tree
Hide file tree
Showing 59 changed files with 5,521 additions and 4,404 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ E-Maj - Change log
###Enhancements:###
* Remove the support of postgres versions prior V11.
* Improve the sequences rollback processing: move it at the beginning of the
overall E-Maj rollback; report the number effectively processed sequences.
overall E-Maj rollback; rollback sequences in a dedicated elementary step
that can be monitored as other steps; report the number effectively
processed sequences.
* Minor code changes, in particular to take benefit from the features brought
by Postgres 9.6, 10 and 11.
* Improve the performance of log tables TRUNCATEs.
Expand Down
4 changes: 2 additions & 2 deletions docs/en/mainFunctions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To be sure that no concurrent transaction updates any table of the group during

The E-Maj rollback takes into account the existing triggers and foreign keys on the concerned tables. More details :doc:`here<rollbackDetails>`.

When the volume of updates to cancel is high and the rollback operation is therefore long, it is possible to monitor the operation using the :ref:`emaj_rollback_activity() <emaj_rollback_activity>` function or the :doc:`emajRollbackMonitor.php <rollbackMonitorClient>` client.
When the volume of updates to cancel is high and the rollback operation is therefore long, it is possible to monitor the operation using the :ref:`emaj_rollback_activity() <emaj_rollback_activity>` function or the :doc:`emajRollbackMonitor <rollbackMonitorClient>` client.

When the rollback operation is completed, the following are deleted:

Expand Down Expand Up @@ -148,7 +148,7 @@ At the beginning and at the end of the operation, the function automatically set

where rollback.time represents the start time of the transaction performing the rollback, expressed as “hours.minutes.seconds.milliseconds”.

When the volume of updates to cancel is high and the rollback operation is therefore long, it is possible to monitor the operation using the :ref:`emaj_rollback_activity() <emaj_rollback_activity>` function or the :doc:`emajRollbackMonitor.php <rollbackMonitorClient>` client.
When the volume of updates to cancel is high and the rollback operation is therefore long, it is possible to monitor the operation using the :ref:`emaj_rollback_activity() <emaj_rollback_activity>` function or the :doc:`emajRollbackMonitor <rollbackMonitorClient>` client.

Following the rollback operation, it is possible to resume updating the database, to set other marks, and if needed to perform another rollback at any mark, including the mark set at the beginning of the rollback, to cancel it, or even delete an old mark that was set after the mark used for the rollback.

Expand Down
2 changes: 2 additions & 0 deletions docs/en/rollbackDetails.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Then, for each table having changes to revert, the elementary steps are chained.
* reseting the state of application triggers;
* re-enabling E-Maj triggers.

The processing of all sequences concerned by the E-Maj rollback is performed by a single elementary step that is scheduled at the beginning of the operation.

For each elementary step, the function that drives the plan execution updates the *emaj_rlbk_plan* table. Reading this table’s content may bring interesting information about the way the E-Maj rollback operation has been processed.

If the *dblink_user_password* parameter is set, the *emaj_rlbk_plan* updates are processed into autonomous transactions, so that it is possible to look at the rollback operation in real time. That’s what the :doc:`emajRollbackMonitor<parallelRollbackClient>` and :doc:`Emaj_web<webUsage>` clients do.
Expand Down
4 changes: 2 additions & 2 deletions docs/fr/mainFunctions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Pour être certain qu'aucune transaction concurrente ne mette à jour une table

Le rollback E-Maj prend en compte la présence éventuelle de triggers et de clés étrangères sur la table concernée. Plus de détails :doc:`ici <rollbackDetails>`.

Lorsque le volume de mises à jour à annuler est important et que l'opération de rollback est longue, il est possible de suivre l'avancement de l'opération à l'aide de la fonction :ref:`emaj_rollback_activity() <emaj_rollback_activity>` ou du client :doc:`emajRollbackMonitor.php <rollbackMonitorClient>`.
Lorsque le volume de mises à jour à annuler est important et que l'opération de rollback est longue, il est possible de suivre l'avancement de l'opération à l'aide de la fonction :ref:`emaj_rollback_activity() <emaj_rollback_activity>` ou du client :doc:`emajRollbackMonitor <rollbackMonitorClient>`.

A l'issue de l'opération de rollback, se trouvent effacées :

Expand Down Expand Up @@ -149,7 +149,7 @@ De plus, en début et en fin d'opération, la fonction pose automatiquement sur

où *<heure_du_rollback>* représente l'heure de début de la transaction effectuant le rollback, exprimée sous la forme « *heures.minutes.secondes.millisecondes* ».

Lorsque le volume de mises à jour à annuler est important et que l'opération de rollback est longue, il est possible de suivre l'avancement de l'opération à l'aide de la fonction :ref:`emaj_rollback_activity() <emaj_rollback_activity>` ou du client :doc:`emajRollbackMonitor.php <rollbackMonitorClient>`.
Lorsque le volume de mises à jour à annuler est important et que l'opération de rollback est longue, il est possible de suivre l'avancement de l'opération à l'aide de la fonction :ref:`emaj_rollback_activity() <emaj_rollback_activity>` ou du client :doc:`emajRollbackMonitor <rollbackMonitorClient>`.

A l'issue du rollback, il est possible de poursuivre les traitements de mises à jour, de poser d'autres marques et éventuellement de procéder à un nouveau rollback sur une marque quelconque, y compris la marque automatiquement posée en début de rollback, pour annuler ce dernier, ou encore une ancienne marque postérieure à la marque utilisée pour le rollback.
oDes rollbacks de différents types (*logged* / *unlogged*) peuvent être exécutés en séquence. on peut ainsi procéder à l'enchaînement suivant::
Expand Down
2 changes: 2 additions & 0 deletions docs/fr/rollbackDetails.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Ensuite, pour chaque table pour laquelle existent des mises à jour à annuler,
* la remise en l’état de triggers applicatifs ;
* la réactivation des triggers E-Maj.

Le traitement de l’ensemble des séquences concernées par le rollback E-Maj est effectué par une unique étape élémentaire planifiée en début d’opération.

A chaque étape élémentaire, la fonction qui pilote l’exécution du plan met à jour la table *emaj_rlbk_plan*. La consultation de cette table peut donner des informations sur la façon dont un rollback E-Maj s’est déroulé.

Si le paramètre *dblink_user_password* est valorisé, les mises à jour de la table *emaj_rlbk_plan* sont réalisées dans des transactions autonomes, de sorte qu’il est possible de visualiser l’avancement du rollback en temps réel. C’est ce que font les clients :doc:`emajRollbackMonitor<parallelRollbackClient>` et :doc:`Emaj_web<webUsage>`.
Expand Down

0 comments on commit 207dd94

Please sign in to comment.