Deleting Events in Team Calendar that are part of a repeating Event cause duplicates in the database, which causes performance issues and java.lang.OutOfMemoryError when viewing Team Calendars as the duplicates are loaded back into memory when re-loading the Calendar.
- Confluence 6.9.0
- Team Calendar 6.0.0 or 5.5.4
This is quite tricky to reproduce with clear, concise steps. It may differ but in general
- In Team Calendars, create an all day Event that repeats every day and never ends
- Delete one event, at least a week after the first one
- Check the Team Calendar Exclusion table for duplicates (this is for Postgres, adjust as necessary)
There should be one event listed, the deleted one
- Click on a date before the deleted event, and select All Future Events
- Check the Team Calendar Exclusion table for all duplicates (this is for Postgres, adjust as necessary)
The Events are not removed.
Run the following query to see if you may be affected by this issue (this is for Postgres, adjust as necessary):
If there are rows returned, it's possible you are experiencing this issue, especially if the count for any row is high.
There should be only be two rows in AO_950DC3_TC_EVENTS_EXCL and the Events should be removed.
The below exception is thrown in the atlassian-confluence.log file:
Upgrade to Team Calendars 6.0.12 which contains a fix for this issue.
Reviewing the heap dump from the java.lang.OutOfMemory error we can see that there are a few very large threads loaded with duplicates of the data, for example
The com.mysql.jdbc.JDBC42ResultSet is pulling all the data from AO_950DC3_TC_EVENTS_EXCL. http-nio-8090-exec-2 is the associated user thread.
The URL in the HAR fill shows it as
And this returns all the data, or generates the java.lang.OutOfMemoryError.
The error is caused by this code
The only option is to delete the duplicates in the AO_950DC3_TC_EVENTS_EXCL table and informing users to not delete All Future Events.
You can remove the duplicates by adding then removing this index
Delete the duplicates with (this may take some time)