History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RHQ-662
Type: New Feature New Feature
Status: Accepted Accepted
Priority: Minor Minor
Assignee: Unassigned
Reporter: Joseph Marques
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RHQ Project

support seamless upgrade process for resource key changes

Created: 10/Jul/08 02:01 PM   Updated: 13/Oct/08 03:37 PM
Component/s: Plugin Container
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Dependency
 

Date of First Response: 17/Jul/08 02:33 PM


 Description  « Hide
use case: after some plugin has been released and used in the field for some time, we realize that the resource key doesn't uniquely identify resources as well as we thought it would...to the extent X different resources are discovered as a single resource instance, suppressing X-1 of them.

so, if we enhance the plugin to use a better resource key, then we have the issue that any pre-existing resources using the old key will be orphaned. since resource key is the mechanism by which we match up existing, server-side persisted resources with agent-side discovered resources during the inventory sync/merge process. so, it would be nice if there existed a mechanism to improve resource key uniqueness for customers that need additional uniqueness per agent, but which kept the existing resources already in inventory working.

a quick strategy, not to difficult to implement would be:

* add optional getPreviousKey to the api
** if previousKey != null && previousKey != newlyDiscoveredKey && previousKey == persistedKey, then update persisted key to use newly discovered key

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Crouch - 17/Jul/08 02:33 PM
We'll need this when we implement the new resource key for apache instances which a customer is looking for.

Ian Springer - 17/Jul/08 03:11 PM
I'm not sure the getPreviousKey() API strategy will work. In the Apache case, if the current version of the Apache plugin, which uses the server root dir as the key, only finds 1 out of 10 of running instances that all share the same server root dir, then the new version of the Apache plugin, which uses the httpd.conf file path as the key, finds all 10 of the running instances, then getPreviousKey() would return the server root dir for all 10 instances, and there would be no way for the PC to match the correct instance up to the Resource that was discovered by the old version of the plugin.

Joseph Marques - 17/Jul/08 03:23 PM
hmm...because we'll find ten, and we only want 1 of them to map to the exist instance and the other 9 as new instances? what would actually happen in this case? would each instance discovery try to map to the existing one, and then the last guy would win? if that's the case, even though it's odd, maybe it's ok.

perhaps, though, we need a more sophisticated strategy if we want to support this?

Ian Springer - 17/Jul/08 03:28 PM
Yeah, I think the last one would win. The problem is, the last one might not correspond to the same instance that was originally discovered, and in that case, you'd have a bunch of historical data on the Resource that corresponds to some other Apache instance.

Charles Crouch - 17/Jul/08 03:44 PM
I don't think we need to support this case, at least I'm not aware of any circumstances when a plugin has munged N servers to 1 server and then the user has been happily going along just monitoring the one. Instead most people complain immediately that autodiscovery is broken. I don't think its feasible to let the user choose which of the new instances mapped to the old instance.

In the specific instance of the customer with the Apache Server, I don't believe any instances are currently being monitored since not all of them could be added to the inventory.

Charles Crouch - 17/Jul/08 04:28 PM
(3:54:32 PM) ips: to make the API most flexible, we might want to make it getPreviousResourceKeys()
(3:54:44 PM) ips: and return Set<String>
(3:55:05 PM) ccrouch: to deal with multiple changes?
(3:55:10 PM) ips: yeah
(3:55:18 PM) ccrouch: v1 -> v2 -> v3 ?
(3:55:36 PM) ccrouch: or really v1 -> v3 and v2 -> v3
(3:56:42 PM) ips: yeah, the latter i think
(3:57:19 PM) ips: if (getPrevKeys().contains(existingResource
(3:57:47 PM) ips: .getKey()) then existingResource.setKey(newKey)

Charles Crouch - 24/Jul/08 02:10 PM
Dropping to minor since the driving jira, RHQ-690, is no longer a high priority

Greg Hinkle - 29/Jul/08 09:16 PM
Future release

Charles Crouch - 18/Aug/08 11:52 AM
Another related issue that could be addressed once this issue is resolved:
https://jira.jboss.org/jira/browse/JBMANCON-378