[BZ 1149265] - Main menu bar appears on top of Favorites menu in IE - Incorporating the changes from Jay's pr #137. I.e. I18n, Remove the '#' href from the current user dropdown
[BZ 1152807] changing aggregation settings should not require server server restart
[1139735] fix test failures
Now that the storage installer needs to contact the DB to version-stamp the
rhq_storage_node table, the cassandra installer upgrade tests failed, because
they support no DB infrastructure.  To get around this added an installer
option to ignore the version stamping.  These options are not user-visible,
and who knows, maybe someday support will have a reason to use it.
[1151441] fix i-test failures
We can't cache the server name in the static block because i-tests don't
set rhq.server.high-availbility.name that early in the setup. It was fine
for production. So, now lazily cache the server name at the time
of the first request for server name.
[1151441] fix i-test failures (2)
The i-tests actually set/restore rhq.server.high-availability.name sysprop
in the before/after methods.  This allows testng to jump around and execute
tests in different classes, in different orders, while the server name
remains correct for each test.  Update the server name caching
mechanism to reset the cache when sysprop changes are detected.  I don't
think this has any production use case, but it's required for testing,
doesn't cost much, and still keeps the original fix for this BZ intact.
Move purge settings to a new "Advanced Purge Settings" group (hidden by default)
Bug 1145776 - RHQ_PARTITION_EVENT data not purged automatically

Added partition event and partition event details purge
It's disabled by default and configurable through System Settings.

Added partition event test in DataPurgeJobTest

Also, refactoring DataPurgeJob and DataPurgeJobTest
Bug 1139433 - Deadlock in deletion of RHQ_RESOURCE_ERROR, possibly in resource upgrade?

When saving a resource error, we first delete existing errors if the error type is one of:
* INVALID_PLUGIN_CONFIGURATION
* AVAILABILITY_CHECK
* UPGRADE
I'm not sure why we don't if the error type is DISABLED_TYPE.

The goal is to keep only one copy of these error types.

Here's my analysis of the deadlock report attached to the BZ.

Due to the type of locks (row locks) and the queries involved, it looks like the deadlock is the consequence of concurrent calls to ResourceManagerBean#clearResourceConfigErrorByType with the same parameters. Such concurrent calls would not necessarily lead to a deadlock. It would happen only if the row locking order is different. My knowledge of Oracle is limited but I'd say this is possible if the two queries get a different execution plan. I tried to figure out why the same query could lead to a different execution plan and one possible reason would be that one is using the index on resourceId and the other one is not.

This commit addresses the issue by changing the way previous errors are deleted. Now before delete we select an ordered list of primary keys. Then we delete the rows by primary key. Consequently, two competing sessions will never lock rows in different orders.

There's another issue due to the way resource errors are implemented. Two competing sessions will delete previous errors but both will insert a row. A DataPurgeJob task has been added to remove such duplicates, if any.
Bug 1139433 - Deadlock in deletion of RHQ_RESOURCE_ERROR, possibly in resource upgrade?

I checked Git history. From the looks of it, DISABLED_TYPE was added later in the game.
To me there's no reason why we let more than DISABLED_TYPE error per resource be persisted.
Bug 1145778 - Purge RHQ_RESOURCE_ERROR table as well

The fix for "Bug 1139433 - Deadlock in deletion of RHQ_RESOURCE_ERROR, possibly in resource upgrade?" enforces "only single error of a type for a given resource".

This change is to clear stale AVAILABILITY_CHECK errors (if a resource AVAIL is up, then there's no need to keep the resource error)

* INVALID_PLUGIN_CONFIGURATION -> auto cleaned when the agent starts the resource container.
* UPGRADE -> we need to keep it to inform the user
* DISABLED_TYPE -> we need to keep it to inform the user
Bug 1131726 - Data from RHQ_CONFIG_UPDATE never purged

Remove old resource config and group resource config updates from the
database.

The configuration and configuration properties entities get removed as
well.

An old config update may stay in the database if it is the last successful one.

An old group config update may stay in the database if one of the
children config update is the last succesful one for the target resource.