Revert the change of the MARK_DELETED event into DELETE_MARK. Change the CLEANUP_ROLLBACK_STATE hist_function into CLEANUP_RLBK_STATE. And replace the (DBLINK, OPEN CNX) and (DBLINK, CLOSE CNX) hist_function + hist_event into simple DBLINK_OPEN_CNX and DBLINK_OPEN_CNX hist_function records.
Also move the dblink extension detection at the end of the installation procedure.
…j_viewer role. Instead, create a new emaj_visible_param view that provides the same visibility, except for the value of the new 'dblink_user_password' parameter that is masked and grant select to emaj_adm and emaj_viewer roles.
…ll other E-Maj ids are of type bigint, but it seems to be largely overstated for this case.
Suppress trailing spaces, add or adjust some comments, align type clauses in DECLARE sections, replace remaining ':=' by '=' operators.
…e log tables reorganization.
… tables and sequences, like other main rollback functions.
… clause for the emaj_tuple column. With the new rollback coding, this specific ordering is now useless.
… the per table rollback functions that are now useless. Improve the CHANGES file to report the optimizations done in the rollback processing.
… steps by keeping estimated quantities in emaj_rlbk_stat, instead of real quantities. This is also more coherent with what is done for other steps and do not lead to really less accurate estimates.
…ssions = 1. Otherwise, use UNLOGGED table with pg9.1+ or standart table with pg 9.0-.
… phase commit when only a single session is used. This allows to use TEMP tables in the rollback processing when the number of requested session equals 1. Also call the _rlbk_init() function after the transactions have been started.
…lue to 4 ms. Adjust the way steps duration are recorded. Remove the 'LOCK_TABLE' event from the emaj_rlbk_plan table at the end of the rollback operation (they are not useful any more). For each rollback operation, add a pseudo 'CTRL+DBLINK' or 'CTRL-DBLINK' step to estimate and record the time needed to chain the steps execution, with ou without using dblink connections. Use them in all time estimations. And some minor coding improvements.
…most recently completed operations. And a bug has been fixed.
Reject the dblink connection if the transaction is not in READ COMMITTED isolation level. For parallel rollbacks (number of sessions > 1), check that the dblink connection is possible (otherwise, it generates endless locks between sessions). Being in READ COMMITTED isolation level, optimize the accesses to rollback tables by avoiding to use dblink for SELECT only statements. Rename into 'rlbk#' the dblink connection name suffix used for rollback operations.
…tional. If dblink is not already installed at E-Maj installation time, issue a warning message to advise to also install dblink.
…nitor.php) into a new client.sql script added to the non regression tests scenarios. Also remove some old references to pg 8.2 test environment.
Adjust some costs. Rename the 'fixed_table_with_rollback_duration' parameter into 'fixed_step_rollback_duration' to better reflect its meaning. Create and use a new 'fixed_dblink_rollback_duration' parameter to systematicaly take into account the dblink overhead. In passing, optimize the duration estimate processing by directly inserting the duration estimate at insert time for steps easy to evaluate.
…LL when there was no update to rollback.
… and emaj_alter_group() time. Replace the _check_class() function by a new _check_group_content() function. This function performs similar checks but in a more efficient set oriented manner. It also checks that no application table belongs to an E-Maj secondary schema. When a check fails, it now returns the list of faulting tables and not only the first detected.
…mark names are built, by simply using the rollback start time already stored into the emaj_rlbk table.
…e phpPgAdmin plugin. It calls the main internal rollback functions after initialisation. Called asynchronously, it allows the ppa plugin to switch on the rollback monitoring just after the rollback submission.
…ge for the rollback operation (either OK or KO). Store a completion message (similar to the message inserted into the emaj_hist table) when the operation goes well. And trap the errors in all main rollback functions to populate this new column if a problem occurs. (Some additional trapping to add when pg 8.3 will not be supported any more)
…d by 'DELETE MARK'.
…nor an unlogged table.
… about in progress rollback operations. It returns a set of rows of type emaj_rollback_activity_type. They contain a description of each running rollback operation, as well as a remaining duration estimate and a percentage of work already done. emaj_adm and emaj_viewer roles can call it.
… functions, namely emaj_estimate_rollback_group() and emaj_estimate_rollback_groups(), the later estimating the duration of a multi-groups rollback. They share some pieces of code with the rollback functions. A third parameter specifies whether the rollback is logged or not.
…o a new _rlbk_check() function so that these checks can be shared with the future emaj_estimate_rollback_groups() functions.
…the future _estimate_rollback_groups() function. Mainly remove the NOT NULL attribute to some emaj_rlbk tables.
…l() function instead of emaj_log_stat_group() to get and check the estimated number of updates to rollback for each table.
Add the purge of all rollback tables (except emaj_rlbk_stat), set the default value for the 'history retention' parameter to 1 year instead of 1 month, and record the purge into the emaj_hist table if rows have really been deleted.
…perations progress. 3 tables have been created: emaj_rlbk, emaj_rlbk_session and emaj_rlbk_plan to register rollbacks and their execution plan. During the rollback operation, these 3 tables are updated, if possible, by autonomous transactions, using dblink. To use dblink, the dblink contrib or extension must have been installed and a 'dblink_user_password' parameter must have been set into the emaj_param table. For security reason, emaj_viewer roles are not allowed to look at emaj_param. The emaj_fkey table has been suppressed. All internal functions have been renamed. The parallel rollback client has been updated accordingly. The tables are now affected to sessions taking into account the duration estimates of all steps, including those that manage foreign keys. The real durations of some short steps like log triggers disabling and enabling are now recorded into the rlbk_stat table. Foreign keys processing are now processed as close to the table rollback as possible to take benefit from tables content currently in shared buffers or OS cache. A new emaj_cleanup_rollback_state() function set the final COMMITTED or ABORTED state of rollback operations. This function is regularly called by other emaj function, but the emaj administrator may also use it. This commit also fix a rare case that may arise when a rollback is asked while tables are continuously updated. At the beginning of a rollback operation, if a table known as 'not needing rollback' at initialisation time is updated before the locking step, this table will not be rolled back, generating a loss of consistency between tables of the group. A check is now added, so that the rollback safely fails if this happens. There is some more work to do around this major change. But we now have a stable point with this commit.
…column named group_is_logging. This lowers the risk of inserting bad values for this data, and using an enum column type with only 2 values is not worth the trouble.