Issue Details (XML | Word | Printable)

Key: SAILFIN-622
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: srinik76
Reporter: sankarpn
Votes: 0
Watchers: 0
Operations

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

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

Created: 26/Feb/08 06:41 PM   Updated: 24/Oct/08 12:42 AM   Resolved: 24/Oct/08 12:42 AM
Component/s: load_balancer
Affects Version/s: 1.0
Fix Version/s: milestone 1

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 622
Tags: shark-na
Participants: jagadesh, kshitiz_saxena, prasads, sankarpn, Satish Kumar, srinik76 and Yamini K B


 Description  « Hide

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



srinik76 added a comment - 26/Feb/08 11:12 PM

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.


sankarpn added a comment - 06/Mar/08 09:31 AM

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.


srinik76 added a comment - 10/Mar/08 12:39 AM

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.


srinik76 added a comment - 19/Mar/08 11:24 PM

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


Satish Kumar added a comment - 02/Apr/08 05:29 AM

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


Yamini K B added a comment - 21/Apr/08 01:42 AM

changing to appropriate category


prasads added a comment - 19/May/08 09:57 PM

Marking these bugs as shark-na


jagadesh added a comment - 06/Aug/08 11:10 AM

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


prasads added a comment - 14/Aug/08 11:38 AM

Marking all of them as P3


kshitiz_saxena added a comment - 25/Sep/08 11:03 PM

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


srinik76 added a comment - 25/Sep/08 11:57 PM

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


srinik76 added a comment - 13/Oct/08 04:14 AM

Discussed with prasad, moving it as P3


srinik76 added a comment - 13/Oct/08 04:16 AM

Changing the priority to P3


srinik76 added a comment - 24/Oct/08 12:42 AM

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