sys_datalog after successfull replication

Discussion in 'Developers' Forum' started by Blackbit, Jan 27, 2012.

  1. Blackbit

    Blackbit New Member

    Hi!

    Do you think there's any reason why the clients should not clear the entry from the master sys_datalog after the successfull replication?

    I patched the file server/lib/classes/modules.inc.php to do after the replication. Like this:

    Code:
    if($app->db->errorNumber > 0) {
    	$replication_error = true;
    	$app->log("Replication failed. Error: (" . $d[dbtable] . ") in MySQL server: (".$app->db->dbHost.") " . $app->db->errorMessage . " # SQL: " . $sql,LOGLEVEL_ERROR);
    } else {
    	$app->log('Replicated from master: '.$sql,LOGLEVEL_DEBUG);
    	$app->dbmaster->query("DELETE FROM sys_datalog WHERE datalog_id = ".$d["datalog_id"]);
    	$app->log("Deleting sys_datalog ID ".$d["datalog_id"]." on master",LOGLEVEL_DEBUG);
    }
    
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There are several reasons why the entrys are kept for 30 days in the system:

    1) A server can have more then one slave replicating the same records (mirror), if you delete records immedeately, then the other slaves cant replicate them anymore or will only partially replicate them. The current system ensures that all slave servers get back in sync automatically even if a slave is offline for some days.

    2) The sys_dalaog is kept as detailed action log for every action that ISPConfig has done so that the administrator can reproduce problems and can investigate actions done by its users or clients.
     

Share This Page