Bug #33769 avoid cascading deletes after removing agents
Submitted: 9 Jan 2008 14:14 Modified: 9 Jan 2015 10:00
Reporter: Scott Noyes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor Severity:S4 (Feature request)
Version:1.2 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[9 Jan 2008 14:14] Scott Noyes
Description:
Removing agents causes all history to be deleted in a single transaction via cascading foreign keys, which can take a very long time. Removing multiple agents at once can effectively shut down monitoring for several days.

How to repeat:
Run a production system with half a dozen slaves, then remove all those slaves at once after much history has accumulated.

Suggested fix:
Rather than cascading deletes for all data, do something like:

o Remove all data collection and advisor schedules for the agent
o Enter a loop that removes all data collection for the agent in chunks (1000 rows, 10000 rows, whatever)
o Once complete, remove all other information about the agent/server etc.

Would also like some extra verbose information on the progress during one of these deletes or rollbacks.