ocsinventory-server-2.0.5 session.pm breaks mysql replication of ocsweb db
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OCS Inventory: Server |
Incomplete
|
Medium
|
mortheres |
Bug Description
package Apache:
if the below code is executed...
> # To avoid race conditions
> if( !$dbh->do("INSERT INTO engine_mutex(NAME, PID, TAG) VALUES(
> &_log(315,
> return;
and replicated to a slave db, it will also attempt to execute this query. as there's a primary key on name and tag, it would be safer to check whether we already have any records with that name and tag. Here's how I worked around the issue:
< my $check_clean_exists = $dbh->prepare(
< if($check_
< $dbh->do('DELETE FROM engine_mutex WHERE NAME="SESSION" AND TAG="CLEAN"', {}, $$ );
< &_log(312,
< $dbh->do("INSERT INTO engine_mutex(NAME, PID, TAG) VALUES(
< &_log(313,
you could as well just log and return, but I leave that up to you ocs experts.
affects: | ocsinventory-deploy-tool → ocsinventory-server |
Changed in ocsinventory-server: | |
assignee: | nobody → mortheres (mortheres) |
Changed in ocsinventory-server: | |
importance: | Undecided → Medium |
Changed in ocsinventory-server: | |
status: | New → Incomplete |
Hi,
I was not able to reproduce the problem using a MySQL slave server. Can you tell me on which case the problem happens ? On most of the computers inventories ? In standard case, the "INSERT INTO" request should only be executed on master server not on the slave.
Kind regards,
--
Guillaume