Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2477

Configuration changes not persisted to file when cluster:config-propset is executed in a cluster of nodes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • cellar-3.0.0
    • cellar-3.0.0
    • cellar
    • None

    Description

      Let's suppose a cluster with two nodes: a producer and a consumer, both in default group.

      From producer node cluster:config-propset command is executed to change a property value in org.apache.karaf.features PID.

      Example:

      $ cluster:config-propset default org.apache.karaf.features featuresBoot config,cellar
      

      featuresBoot value is changed on both nodes, but is not updated on etc/org.apache.karaf.features.cfg file.

      In karaf.log file a message like follows is written :

      CELLAR CONFIG: retrieved event ClusterConfigurationEvent [type=0, id=org.apache.karaf.features, sourceNode=HazelcastNode [id=localhost:5701, host=localhost, port=5701], sourceGroup=org.apache.karaf.cellar.core.Group@5c13d641, destination=null, force=false, postPublish=false] while groupManager is not available yet
      

      After debugging code I have found that groupManager attribute is not initialized in class org.apache.karaf.cellar.config.ConfigurationEventHandler

      eventHandler bean definition in file config/src/main/resources/OSGI-INF/blueprint/blueprint.xml has no dependency injection for groupManager.

      Comparing this definition with other branches looks like a regression, because on branch cellar-2.2.x or cellar-2.3.x this bean definition is

      	    <!-- Cluster Event Handler -->
      	    <bean id="eventHandler" class="org.apache.karaf.cellar.config.ConfigurationEventHandler"
      	          init-method="init" destroy-method="destroy">
      	        <property name="clusterManager" ref="clusterManager"/>
      	        <property name="groupManager" ref="groupManager"/>
      	        <property name="configurationAdmin" ref="configurationAdmin"/>
      	        <property name="storage" value="${storage}"/>
      	    </bean>
      

      Injecting groupManager definition will solve the issue.

      Attachments

        1. KARAF-2477-cellar-3.0.0.patch
          0.7 kB
          Pablo Muñiz

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            pablo.muniz Pablo Muñiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: