sailfin
  1. sailfin
  2. SAILFIN-622

dcr file not uploaded to DAS config directory with set-dcr-file command

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: milestone 1
    • Component/s: load_balancer
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      SailFin B21

      The set-dcr-file command doesn't upload the dcr file to the config directory

      echo "CURRENT DIR" 1>sample-dcr-file.xml

      asadmin create-converged-lb-config dcr-clb-config

      asadmin set-dcr-file --dcrfile sample-dcr-file.xml dcr-clb-config
      Command set-dcr-file executed successfully.

      asadmin get domain.converged-lb-configs.dcr-clb-config.converged-lb-policy
      .dcr-file
      domain.converged-lb-configs.dcr-clb-config.converged-lb-policy.dcr-file =
      sample-dcr-file.xml.v0

      ls /usr/sankar/ws/sailfin/sailfin/admin_domain_dir/admincli_domain/config
      admch
      admin-keyfile
      admsn
      cacerts.jks
      default-cluster-config
      default-config
      default-domain.xml.templatetransformed0
      default-domain.xml.templatetransformed1
      default-domain.xml.templatetransformed2
      default-domain.xml.templatetransformed3
      default-domain.xml.templatetransformed4
      default-domain.xml.templatetransformed5
      default-domain.xml.templatetransformed6
      default-web.xml
      domain-passwords
      domain-registry
      domain.xml
      keyfile
      keystore.jks
      login.conf
      secure.seed
      server.policy
      sun-acc.xml
      wss-server-config-1.0.xml
      wss-server-config-2.0.xml

        Activity

        Hide
        srinik76 added a comment -

        The dcr file is not uploaded to the config directory. It is uploaded to the
        directory where clb xml is generated. In this case please check the file under
        the directory
        /usr/sankar/ws/sailfin/sailfin/admin_domain_dir/admincli_domain/config/default-cluster-config

        I am closing this bug as INVALID.

        Show
        srinik76 added a comment - The dcr file is not uploaded to the config directory. It is uploaded to the directory where clb xml is generated. In this case please check the file under the directory /usr/sankar/ws/sailfin/sailfin/admin_domain_dir/admincli_domain/config/default-cluster-config I am closing this bug as INVALID.
        Hide
        sankarpn added a comment -

        As per this comment from Sreeni , reopening the bug.

        We are planning to fix this issue. When the clb config is not used by CLB,
        currently dcr file is not copied to any config directory. We are planning to fix
        this by copying the dcr file to the domain/config directory. Please reopen this
        bug with synopsis changed or raise a new bug with the comment that set-dcr-file
        fails in the case when CLB config not used by any CLB.

        Show
        sankarpn added a comment - As per this comment from Sreeni , reopening the bug. We are planning to fix this issue. When the clb config is not used by CLB, currently dcr file is not copied to any config directory. We are planning to fix this by copying the dcr file to the domain/config directory. Please reopen this bug with synopsis changed or raise a new bug with the comment that set-dcr-file fails in the case when CLB config not used by any CLB.
        Hide
        srinik76 added a comment -

        When a clb config is not used by any cluster config and set-dcr-file is done on
        the clb config the dcr xml need to be copied to domain config directory than
        copying to cluster config directory.

        Show
        srinik76 added a comment - When a clb config is not used by any cluster config and set-dcr-file is done on the clb config the dcr xml need to be copied to domain config directory than copying to cluster config directory.
        Hide
        srinik76 added a comment -

        Checking in ConvergedLbConfigsMBean.java;
        /cvs/sailfin/administration/src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java,v
        <-- ConvergedLbConfigsMBean.javanew revision: 1.20; previous revision: 1.19
        done

        If clb config is not used and set-dcr-file is used on that clb config leave the
        dcr xml file in domain config directory and do not copy to any cluster config
        directory
        Issue number: 622
        Obtained from:
        Submitted by:
        Reviewed by: Pankaj

        Tests Run: Sailfin Cluster QL

        Index: ConvergedLbConfigsMBean.java
        ===================================================================
        RCS file:
        /cvs/sailfin/administration/src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java,v
        retrieving revision 1.19
        diff -u -r1.19 ConvergedLbConfigsMBean.java
        — ConvergedLbConfigsMBean.java 18 Mar 2008 06:38:54 -0000 1.19
        +++ ConvergedLbConfigsMBean.java 20 Mar 2008 06:19:53 -0000
        @@ -860,22 +860,49 @@
        String sDcrOldFile = iRoot + File.separator +
        PEFileLayout.CONFIG_DIR + File.separator + dcrFile;
        File oldFileName = new File(sDcrOldFile);
        Object[] configsUsingCLBConfig =
        getConfigsUsingCLBConfig(clbConfigName);

        • if (dcrOldFileWOVersion.equals(dcrFile)) {
        • // Following gets executed when the uploaded dcr file name is
          same as previous dcr file name
        • dcrNewFile = ClbAdminEventHelper.getConfigFileNewValue(dcrOldFile);
        • try {
          + // If clb config is not used by any CLB,
          + // do not copy the dcr file from the config directory to cluster config
          + if (isClbCfgUsed(clbConfigName)) {
          + if (dcrOldFileWOVersion.equals(dcrFile)) {
          + // Following gets executed when the uploaded dcr file name
          is same as previous dcr file name
          + dcrNewFile =
          ClbAdminEventHelper.getConfigFileNewValue(dcrOldFile);
          + try {
          + if (configsUsingCLBConfig != null) {
          + for (int i=0; i < configsUsingCLBConfig.length; i++)
          Unknown macro: {+ // Following copies the dcr file from configdirectory to config/<cluster-specific-config> directory+ String sDcrNewFile = iRoot + File.separator +PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i]+ + File.separator + dcrNewFile;+ File newFileName = new File(sDcrNewFile);+ FileUtils.copy(oldFileName, newFileName);++ // Following deletes the dcr file underconfig/<cluster-specific-config> directory+ // Do not delete the old dcr files if debug isset as true+ if (!ClbAdminEventHelper.isClbDebug()) { + String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] + + File.separator + dcrOldFile; + File tmpFile = new File(tmp); + if (tmpFile.exists()) + tmpFile.delete(); + }+ }

          + }
          + } catch (Exception e)

          { + throw new MBeanException(e); + }

          +
          + } else {
          + // Following gets executed when the uploaded dcr file name
          is different from previous dcr file name
          if (configsUsingCLBConfig != null) {
          for (int i=0; i < configsUsingCLBConfig.length; i++) {

        • // Following copies the dcr file from config
          directory to config/<cluster-specific-config> directory
          String sDcrNewFile = iRoot + File.separator +
          PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i]

        + File.separator + dcrNewFile;
        File newFileName = new File(sDcrNewFile);
        FileUtils.copy(oldFileName, newFileName);
        -
        +
        // Following deletes the dcr file under
        config/<cluster-specific-config> directory
        // Do not delete the old dcr files if debug is set
        as true
        if (!ClbAdminEventHelper.isClbDebug())

        { - String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] + String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] + File.separator + dcrOldFile; File tmpFile = new File(tmp); if (tmpFile.exists()) @@ -883,36 +910,13 @@ }

        }
        }

        • } catch (Exception e) { - throw new MBeanException(e); - }

          -

        • } else {
        • // Following gets executed when the uploaded dcr file name is
          different from previous dcr file name
        • if (configsUsingCLBConfig != null) {
        • for (int i=0; i < configsUsingCLBConfig.length; i++) {
        • String sDcrNewFile = iRoot + File.separator +
          PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i]
        • + File.separator + dcrNewFile;

        • File newFileName = new File(sDcrNewFile);
        • FileUtils.copy(oldFileName, newFileName);
          -
        • // Following deletes the dcr file under
          config/<cluster-specific-config> directory
        • // Do not delete the old dcr files if debug is set as true
        • if (!ClbAdminEventHelper.isClbDebug()) { - String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] - + File.separator + dcrOldFile; - File tmpFile = new File(tmp); - if (tmpFile.exists()) - tmpFile.delete(); - }
        • }
          }
          + // Following deletes the dcr file under the
          domains/domain/config directory
          + // sDcrOldFile = iRoot + File.separator +
          PEFileLayout.CONFIG_DIR + File.separator + dcrFile;
          + // File tmpFile = new File(sDcrOldFile);
          + if (oldFileName.exists())
          + oldFileName.delete();
          }
        • // Following deletes the dcr file under the domains/domain/config
          directory
        • // sDcrOldFile = iRoot + File.separator + PEFileLayout.CONFIG_DIR +
          File.separator + dcrFile;
        • // File tmpFile = new File(sDcrOldFile);
        • if (oldFileName.exists())
        • oldFileName.delete();
          } catch (Exception e) { throw new MBeanException(e); }

          @@ -981,4 +985,34 @@
          // for now we supporting both "dashed" and "underscored" names
          return attr.getName().replace('','').equals(name.replace('',''));
          }
          -}
          +
          + private boolean isClbCfgUsed(String clbConfigName) {
          + // check if the specified CLB Config is used by any CLB
          + ConfigContext ctx = AdminService.getAdminService().getAdminContext()
          + .getAdminConfigContext();
          + boolean clbConfigUsed = false;
          + try {
          + Domain domain = (Domain) ctx.getRootConfigBean();
          + Configs configs = domain.getConfigs();
          + if (configs != null) {
          + Config[] configArray = configs.getConfig();
          + for (int i = 0; i < configArray.length; i++) {
          + AvailabilityService avSvc =
          configArray[i].getAvailabilityService();
          + if (avSvc != null) {
          + ConvergedLoadBalancer clb =
          configArray[i].getAvailabilityService()
          +
          .getConvergedLoadBalancer();
          + if (clb != null)

          Unknown macro: {+ if(clb.getConvergedLbConfigName().equals(clbConfigName)) { + clbConfigUsed = true; + break; + }+ }

          + }
          + }
          + }
          + } catch (Exception e)

          { + // ignore exception + }

          + return clbConfigUsed;
          + }
          +}
          \ No newline at end of file

        Reassigning bug to satish to change the implementation in the listener side so
        that the listener will look at domain config directory if it does not find the
        dcr xml in the cluster config directory

        Show
        srinik76 added a comment - Checking in ConvergedLbConfigsMBean.java; /cvs/sailfin/administration/src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java,v <-- ConvergedLbConfigsMBean.javanew revision: 1.20; previous revision: 1.19 done If clb config is not used and set-dcr-file is used on that clb config leave the dcr xml file in domain config directory and do not copy to any cluster config directory Issue number: 622 Obtained from: Submitted by: Reviewed by: Pankaj Tests Run: Sailfin Cluster QL Index: ConvergedLbConfigsMBean.java =================================================================== RCS file: /cvs/sailfin/administration/src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java,v retrieving revision 1.19 diff -u -r1.19 ConvergedLbConfigsMBean.java — ConvergedLbConfigsMBean.java 18 Mar 2008 06:38:54 -0000 1.19 +++ ConvergedLbConfigsMBean.java 20 Mar 2008 06:19:53 -0000 @@ -860,22 +860,49 @@ String sDcrOldFile = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + dcrFile; File oldFileName = new File(sDcrOldFile); Object[] configsUsingCLBConfig = getConfigsUsingCLBConfig(clbConfigName); if (dcrOldFileWOVersion.equals(dcrFile)) { // Following gets executed when the uploaded dcr file name is same as previous dcr file name dcrNewFile = ClbAdminEventHelper.getConfigFileNewValue(dcrOldFile); try { + // If clb config is not used by any CLB, + // do not copy the dcr file from the config directory to cluster config + if (isClbCfgUsed(clbConfigName)) { + if (dcrOldFileWOVersion.equals(dcrFile)) { + // Following gets executed when the uploaded dcr file name is same as previous dcr file name + dcrNewFile = ClbAdminEventHelper.getConfigFileNewValue(dcrOldFile); + try { + if (configsUsingCLBConfig != null) { + for (int i=0; i < configsUsingCLBConfig.length; i++) Unknown macro: {+ // Following copies the dcr file from configdirectory to config/<cluster-specific-config> directory+ String sDcrNewFile = iRoot + File.separator +PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i]+ + File.separator + dcrNewFile;+ File newFileName = new File(sDcrNewFile);+ FileUtils.copy(oldFileName, newFileName);++ // Following deletes the dcr file underconfig/<cluster-specific-config> directory+ // Do not delete the old dcr files if debug isset as true+ if (!ClbAdminEventHelper.isClbDebug()) { + String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] + + File.separator + dcrOldFile; + File tmpFile = new File(tmp); + if (tmpFile.exists()) + tmpFile.delete(); + }+ } + } + } catch (Exception e) { + throw new MBeanException(e); + } + + } else { + // Following gets executed when the uploaded dcr file name is different from previous dcr file name if (configsUsingCLBConfig != null) { for (int i=0; i < configsUsingCLBConfig.length; i++) { // Following copies the dcr file from config directory to config/<cluster-specific-config> directory String sDcrNewFile = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig [i] + File.separator + dcrNewFile; File newFileName = new File(sDcrNewFile); FileUtils.copy(oldFileName, newFileName); - + // Following deletes the dcr file under config/<cluster-specific-config> directory // Do not delete the old dcr files if debug is set as true if (!ClbAdminEventHelper.isClbDebug()) { - String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] + String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] + File.separator + dcrOldFile; File tmpFile = new File(tmp); if (tmpFile.exists()) @@ -883,36 +910,13 @@ } } } } catch (Exception e) { - throw new MBeanException(e); - } - } else { // Following gets executed when the uploaded dcr file name is different from previous dcr file name if (configsUsingCLBConfig != null) { for (int i=0; i < configsUsingCLBConfig.length; i++) { String sDcrNewFile = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig [i] + File.separator + dcrNewFile; File newFileName = new File(sDcrNewFile); FileUtils.copy(oldFileName, newFileName); - // Following deletes the dcr file under config/<cluster-specific-config> directory // Do not delete the old dcr files if debug is set as true if (!ClbAdminEventHelper.isClbDebug()) { - String tmp = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + configsUsingCLBConfig[i] - + File.separator + dcrOldFile; - File tmpFile = new File(tmp); - if (tmpFile.exists()) - tmpFile.delete(); - } } } + // Following deletes the dcr file under the domains/domain/config directory + // sDcrOldFile = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + dcrFile; + // File tmpFile = new File(sDcrOldFile); + if (oldFileName.exists()) + oldFileName.delete(); } // Following deletes the dcr file under the domains/domain/config directory // sDcrOldFile = iRoot + File.separator + PEFileLayout.CONFIG_DIR + File.separator + dcrFile; // File tmpFile = new File(sDcrOldFile); if (oldFileName.exists()) oldFileName.delete(); } catch (Exception e) { throw new MBeanException(e); } @@ -981,4 +985,34 @@ // for now we supporting both "dashed" and "underscored" names return attr.getName().replace(' ',' ').equals(name.replace(' ',' ')); } -} + + private boolean isClbCfgUsed(String clbConfigName) { + // check if the specified CLB Config is used by any CLB + ConfigContext ctx = AdminService.getAdminService().getAdminContext() + .getAdminConfigContext(); + boolean clbConfigUsed = false; + try { + Domain domain = (Domain) ctx.getRootConfigBean(); + Configs configs = domain.getConfigs(); + if (configs != null) { + Config[] configArray = configs.getConfig(); + for (int i = 0; i < configArray.length; i++) { + AvailabilityService avSvc = configArray [i] .getAvailabilityService(); + if (avSvc != null) { + ConvergedLoadBalancer clb = configArray [i] .getAvailabilityService() + .getConvergedLoadBalancer(); + if (clb != null) Unknown macro: {+ if(clb.getConvergedLbConfigName().equals(clbConfigName)) { + clbConfigUsed = true; + break; + }+ } + } + } + } + } catch (Exception e) { + // ignore exception + } + return clbConfigUsed; + } +} \ No newline at end of file Reassigning bug to satish to change the implementation in the listener side so that the listener will look at domain config directory if it does not find the dcr xml in the cluster config directory
        Hide
        Satish Kumar added a comment -

        Needs listener side changes to look at domain config directory if it does not
        find the dcr xml in the cluster config directory ...

        Show
        Satish Kumar added a comment - Needs listener side changes to look at domain config directory if it does not find the dcr xml in the cluster config directory ...
        Hide
        Yamini K B added a comment -

        changing to appropriate category

        Show
        Yamini K B added a comment - changing to appropriate category
        Hide
        prasads added a comment -

        Marking these bugs as shark-na

        Show
        prasads added a comment - Marking these bugs as shark-na
        Hide
        jagadesh added a comment -

        "This bug will be scrubbed and will be upgraded for next relevant milestone builds".

        Show
        jagadesh added a comment - "This bug will be scrubbed and will be upgraded for next relevant milestone builds".
        Hide
        prasads added a comment -

        Marking all of them as P3

        Show
        prasads added a comment - Marking all of them as P3
        Hide
        kshitiz_saxena added a comment -

        Assigning to Srini to update the bug. CLB team suggested different solution for
        this issue.

        Show
        kshitiz_saxena added a comment - Assigning to Srini to update the bug. CLB team suggested different solution for this issue.
        Hide
        srinik76 added a comment -

        This needs to be fixed for 1.5 release, so moving to P2.

        Show
        srinik76 added a comment - This needs to be fixed for 1.5 release, so moving to P2.
        Hide
        srinik76 added a comment -

        Discussed with prasad, moving it as P3

        Show
        srinik76 added a comment - Discussed with prasad, moving it as P3
        Hide
        srinik76 added a comment -

        Changing the priority to P3

        Show
        srinik76 added a comment - Changing the priority to P3
        Hide
        srinik76 added a comment -

        Checking in
        src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java;
        /cvs/sailfin/administration/src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java,v
        <-- ConvergedLbConfigsMBean.javanew revision: 1.48; previous revision: 1.47
        done

        When dcr is already set while creating clb config and later clb is created, dcr
        needs to be copied from domains config directory
        Issue number: 622
        Obtained from:
        Submitted by:
        Reviewed by: Kshitiz

        Tests Run: Sailfin QL, Cluster QL

        Show
        srinik76 added a comment - Checking in src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java; /cvs/sailfin/administration/src/main/java/org/jvnet/glassfish/comms/admin/mbeans/extensions/ConvergedLbConfigsMBean.java,v <-- ConvergedLbConfigsMBean.javanew revision: 1.48; previous revision: 1.47 done When dcr is already set while creating clb config and later clb is created, dcr needs to be copied from domains config directory Issue number: 622 Obtained from: Submitted by: Reviewed by: Kshitiz Tests Run: Sailfin QL, Cluster QL

          People

          • Assignee:
            srinik76
            Reporter:
            sankarpn
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: