Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Duplicate internal IPs from campaign_lead_event_log with master/slave connections. #7806
Please be sure you are submitting this against the staging branch.
When campaign events are triggered by cron tasks, we still spend a few CPU cycles looking up the IP and creating a reference to a local IP. This by itself isn't a problem, however, at high scale (read and write replicas and concurrent cron threads) the problem is multiplied because of the object relationship. The lookup can fail, and new IpAddress entities are created in huge quantities. Similar to #7552 a huge number of duplicate ip_address entities can be created, threatening the MAX_INT limitations. Since ip_address table is tied to 14 foreign key constraints, this could bring a production Mautic instance to a very bad place.
To save both CPU cycles, and to avoid accidental duplication we should avoid trying to log IpAddress entries for cron executed campaign actions.
Steps to reproduce the bug:
(Seriously though, there are maybe 4 companies using Mautic in this way that can replicate this)
Steps to test this PR:
This just confirms that there is not an accidental hard dependency on the ipAddress foreign key.