I suspect that the deadlock caused by insert trigger (for a log of changes some of the facts) DELIMITER $ $ DROP TRIGGER IF EXISTS `facts_insert`; CREATE TRIGGER facts_insert BEFORE INSERT ON `fact_values` FOR EACH ROW BEGIN IF (SELECT `name` FROM `fact_names` where `id` = NEW.fact_name_id) in ('ipaddress', 'dhcp', 'memory_size') THEN SET @ fact_val = (SELECT `value` FROM `fact_values_log` WHERE `host_id` = NEW.host_id AND `fact_name_id` = NEW.fact_name_id ORDER BY `date` DESC LIMIT 1); IF @ fact_val IS NULL OR @ fact_val! = NEW.value THEN INSERT INTO `fact_values_log` SET host_id = NEW.host_id, `fact_name_id` = NEW.fact_name_id, `value` = NEW.value, `date` = CURRENT_TIMESTAMP (); END IF; END IF; END $ $ DELIMITER;
But why there is a deadlock? trigger writes to another table. deadlock occurs only once every 30-60 minutes -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.