[SAILFIN-622] dcr file not uploaded to DAS config directory with set-dcr-file command Created: 26/Feb/08  Updated: 24/Oct/08  Resolved: 24/Oct/08

Status: Resolved
Project: sailfin
Component/s: load_balancer
Affects Version/s: 1.0
Fix Version/s: milestone 1

Type: Bug Priority: Major
Reporter: sankarpn Assignee: srinik76
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 622
Tags: shark-na

 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



 Comments   
Comment by srinik76 [ 26/Feb/08 ]

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.

Comment by sankarpn [ 06/Mar/08 ]

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.

Comment by srinik76 [ 10/Mar/08 ]

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.

Comment by srinik76 [ 19/Mar/08 ]

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

Comment by Satish Kumar [ 02/Apr/08 ]

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

Comment by Yamini K B [ 21/Apr/08 ]

changing to appropriate category

Comment by prasads [ 19/May/08 ]

Marking these bugs as shark-na

Comment by jagadesh [ 06/Aug/08 ]

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

Comment by prasads [ 14/Aug/08 ]

Marking all of them as P3

Comment by kshitiz_saxena [ 25/Sep/08 ]

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

Comment by srinik76 [ 25/Sep/08 ]

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

Comment by srinik76 [ 13/Oct/08 ]

Discussed with prasad, moving it as P3

Comment by srinik76 [ 13/Oct/08 ]

Changing the priority to P3

Comment by srinik76 [ 24/Oct/08 ]

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

Generated at Tue Jul 07 03:13:44 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.