Bug 546382 - [raw-config] Structured config commits fails to mark the revision as the latest
Summary: [raw-config] Structured config commits fails to mark the revision as the latest
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: RHQ Project
Classification: Other
Component: Configuration
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: rhq_spearhead
TreeView+ depends on / blocked
 
Reported: 2009-12-10 18:57 UTC by Preethi Thomas
Modified: 2010-12-16 13:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 537980
Environment:
Last Closed: 2010-12-16 13:57:40 UTC
Embargoed:


Attachments (Terms of Use)
hosts file update (166.63 KB, image/png)
2010-01-07 14:43 UTC, Preethi Thomas
no flags Details

Description Preethi Thomas 2009-12-10 18:57:25 UTC
Description of problem:
If you edit a structured only config and commit you are navigated to the history and the revision is created but none of the revisions are marked with * inidicating current config in the history
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Login to RHQ server with agent running
2. Select the Structured only server
3. Click on the configure tab
4. Click on change properties
5. change a value and click save
  
Actual results:

You are navigated to history and the edit is saved and a new revision is created but none of the revision is marked as current. (No revision is marked with *)
If reload the browser you see that another revision is created and is marked with * indicating that its the current config.
Expected results:

To be able to commit the structured config change


Additional info:

--- Additional comment from pthomas on 2009-11-18 11:26:27 EDT ---

Even the existing plugins fails to commmit the edits from structured config.
It displays a message "Maps updated".

--- Additional comment from ayoung on 2009-11-23 12:25:13 EDT ---

Added this code to ConfigurationManagerBean


+ void dumpProperties(Configuration c) {
+        for (String key : c.getAllProperties().keySet()) {
+            log.error("property " + key + " = " + c.get(key));
+        }
+    }

    @Nullable
    public ResourceConfigurationUpdate updateResourceConfiguration(Subject subject, int resourceId,
        @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newConfiguration)
        throws ResourceNotFoundException {
        // must do this in a separate transaction so it is committed prior to sending the agent request
        // (consider synchronizing to avoid the condition where someone calls this method twice quickly
        // in two different txs which would put two updates in INPROGRESS and cause havoc)
        ResourceConfigurationUpdate newUpdate;
+        dumpProperties(newConfiguration);
        // here we call ourself, but we do so via the EJB interface so we pick up the REQUIRES_NEW semantics
        // this can return null if newConfiguration is not actually different.
        newUpdate = configurationManager.persistNewResourceConfigurationUpdateHistory(subject, resourceId,
            newConfiguration, ConfigurationUpdateStatus.INPROGRESS, subject.getName(), false);



This shows the values that were changed in  the UI being passed down correctly.

--- Additional comment from ayoung on 2009-12-03 17:41:13 EDT ---

Problem was with how the configuration object was shared between raw and structured, which didn't match the pre-existing code.  Code has been pushed to origin/raw-config on Fedora Hosted and confirmed to work on my local machine.  We should see the hudson test failures stop off in a build shortly.

--- Additional comment from pthomas on 2009-12-04 12:45:11 EDT ---

Fails_qa
tried to edit hosts config
the message said "Maps Updated"
And the hosts config UI displayed the edited value. but when I navigated to the history page there was no record of the new commit. Also checked in the hosts file of the managed platform and it did not reflect the change.
But the change stayed in the memory until I logged out of the rhq server.

--- Additional comment from pthomas on 2009-12-10 11:41:48 EDT ---

I think this is user error on my part. moving to fixed.
Will reopen if it fails again.

Comment 1 Preethi Thomas 2010-01-07 14:40:15 UTC
Please ignore the additional comments above. Not sure how that ended up there.

So here is what happens.

For the structured only server this does not happen now. But for an existing plugin, for eg hosts

1. Login to RHQ server with agent running
2. Select the hosts
3. Click on the configure tab
4. Click on change properties
5. change a value and click save


See the message "Configuration update request with id xxx has been sent to the Agent". 

If you refresh the page, you can see that another revision is being added to the history.

Screen shot attached

Comment 2 Preethi Thomas 2010-01-07 14:43:00 UTC
Created attachment 382248 [details]
hosts file update

Comment 3 wes hayutin 2010-02-16 16:52:35 UTC
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.

keyword:
new = Tracking + FutureFeature + SubBug

Comment 4 wes hayutin 2010-02-16 16:58:18 UTC
making sure we're not missing any bugs in rhq_triage

Comment 5 Corey Welton 2010-12-16 13:57:40 UTC
closing per triage


Note You need to log in before you can comment on or make changes to this bug.