Created attachment 522969 [details]
Description of problem: Drift regression, changeset erroneously reports all files as new, again
Version-Release number of selected component (if applicable):
RHQ 4.1.1 09/13/2011 build
Steps to Reproduce:
1. add drift configuration on a filesystem. no includes, no excludes. 60 second interval. enabled.
2. initial version #0 drift changeset is reported (see attached image version0.png)
3. add 1 file (see attached image version1.png)
4. edit 1 file (see attached image version2.png)
5. version #3 changeset erroneously reports all files as new, again (see attached image version4.png)
version #3 changeset reports 12 new files, which is incorrect.
version #3 changeset should not even exist.
attached images. attached agent log. attached server log.
Created attachment 522970 [details]
version 0 changeset
Created attachment 522971 [details]
version 1 changeset
Created attachment 522972 [details]
version 2 changeset
Created attachment 522973 [details]
version 3 changeset
This issue was actually identified by Jay yesterday. The regression was introduced as part of inventory sync work for bug 732102. When the agent runs a discovery scan and new resources are discovered, an inventory sync is triggered. In the agent code that syncs drift configurations with the server, I was treating existing configs as new ones and rescheduling them. This resulted in a new coverage change set being generated. You can see this in the agent.log file that is attached. On line 232 of the log file we have,
2011-09-13 11:54:16,786 INFO [WorkerThread#0[10.0.1.189:44604]] (rhq.core.pc.drift.DriftManager)- Received request to schedule drift detection immediately for [resourceId: 10001, driftConfigurationId: 10001, driftConfigurationName: File System]
Then on line 259 we have,
2011-09-13 12:03:08,620 INFO [InventoryManager.discovery-1] (rhq.core.pc.inventory.AutoDiscoveryExecutor)- Executing server discovery scan...
And finally lines 273 - 275,
2011-09-13 12:03:16,277 INFO [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Syncing local inventory with Server inventory...
2011-09-13 12:03:16,395 INFO [InventoryManager.discovery-1] (rhq.core.pc.drift.DriftManager)- Received request to unschedule drift detection for [resourceId:10001, driftConfigurationId: 10001, driftConfigurationName: File System].
2011-09-13 12:03:16,396 INFO [InventoryManager.discovery-1] (rhq.core.pc.drift.DriftManager)- Scheduling drift detection for DriftDetectionSchedule[resourceId: 10001, driftConfigurationId: 10001, driftConfigurationName: File System]
When drift detection is unscheduled, the snapshot file on disk is removed. Then when the scheduled is created again, the agent will generate a new snapshot and send a coverage change set report to the server which is of course a duplicate.
A check has been put in place so that we only add new schedules and do not delete existing ones.
commit hash: 0b8f83bf0d49e01f3d554a4fcd72258b0f95e08d
verified RHQ 4.1 sprint 5 Test Day.
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE