Support Migration Notice: To update migrated JIRA cases click here to open a new case use www.vmware.com/go/sr | vFabric Hyperic 5.7.0 is Now Available

Hyperic HQ

WebSphere Connection Pool discovery fails with cell scope

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 4.5 Sprint 30, 4.5 M7, 4.5
  • Component/s: Agent / PDK
  • Environment:
    hq 4.4, was6.1 fix31 windows
  • Case Links:
    none
  • Regression:
    No
  • Story Points:
    3
  • Tags:

Description

I defined two JDBC Providers

Name: DB2 UDB for iSeries (Toolbox)
Scope: Cell=jvalkealahti-e6500Node01Cell

Name: DB2 UDB for iSeries (Toolbox) 2
Scope: Node=jvalkealahti-e6500Node01,Server=server1

Below query is used to find the providers(testing using wsadmin):


wsadmin>$AdminControl queryNames WebSphere:type=JDBCProvider,process=server1,node=jvalkealahti-e6500Node01,*

"WebSphere:name=DB2 UDB for iSeries (Toolbox) 2,process=server1,platform=dynamicproxy,node=jvalkealahti-e6500Node01,j2eeType=JDBCResource,J2EEServer=server1,Server=server1,version=6.1.0.31,type=JDBCProvider,mbeanIdentifier=cells/jvalkealahti-e6500Node01Cell/nodes/jvalkealahti-e6500Node01/servers/server1/resources.xml#JDBCProvider_1284720274816,cell=jvalkealahti-e6500Node01Cell,spec=1.0"

"WebSphere:name=DB2 UDB for iSeries (Toolbox),process=server1,platform=dynamicproxy,node=jvalkealahti-e6500Node01,j2eeType=JDBCResource,J2EEServer=server1,Server=server1,version=6.1.0.31,type=JDBCProvider,mbeanIdentifier=cells/jvalkealahti-e6500Node01Cell/resources.xml#JDBCProvider_1284719944232,cell=jvalkealahti-e6500Node01Cell,spec=1.0"

"WebSphere:name=Derby JDBC Provider (XA),process=server1,platform=dynamicproxy,node=jvalkealahti-e6500Node01,j2eeType=JDBCResource,J2EEServer=server1,Server=server1,version=6.1.0.31,type=JDBCProvider,mbeanIdentifier=cells/jvalkealahti-e6500Node01Cell/nodes/jvalkealahti-e6500Node01/servers/server1/resources.xml#builtin_jdbcprovider,cell=jvalkealahti-e6500Node01Cell,spec=1.0"

"WebSphere:name=Derby JDBC Provider (XA),process=server1,platform=dynamicproxy,node=jvalkealahti-e6500Node01,j2eeType=JDBCResource,J2EEServer=server1,Server=server1,version=6.1.0.31,type=JDBCProvider,mbeanIdentifier=cells/jvalkealahti-e6500Node01Cell/resources.xml#builtin_jdbcprovider,cell=jvalkealahti-e6500Node01Cell,spec=1.0"

"WebSphere:name=Derby JDBC Provider,process=server1,platform=dynamicproxy,node=jvalkealahti-e6500Node01,j2eeType=JDBCResource,J2EEServer=server1,Server=server1,version=6.1.0.31,type=JDBCProvider,mbeanIdentifier=cells/jvalkealahti-e6500Node01Cell/nodes/jvalkealahti-e6500Node01/servers/server1/resources.xml#JDBCProvider_1284588046356,cell=jvalkealahti-e6500Node01Cell,spec=1.0"

"WebSphere:name=Samples Derby JDBC Provider (XA),process=server1,platform=dynamicproxy,node=jvalkealahti-e6500Node01,j2eeType=JDBCResource,J2EEServer=server1,Server=server1,version=6.1.0.31,type=JDBCProvider,mbeanIdentifier=cells/jvalkealahti-e6500Node01Cell/nodes/jvalkealahti-e6500Node01/servers/server1/resources.xml#JDBCProvider_1284588062152,cell=jvalkealahti-e6500Node01Cell,spec=1.0"

JDBCProviderQuery is using this check agains the results:

public boolean apply(ObjectName name) {
String server = name.getKeyProperty("Server");
String id = name.getKeyProperty("mbeanIdentifier");
if ((server == null) || (id == null)) { return super.apply(name); }
else { return id.indexOf(server) != -1; }
}

There's also comment in ConnectionPoolCollector:

//XXX seen in samples, two beans where all attributes are equal
//with the exception of mbeanIdentifier

"server1" is checked from mbeanIdentifier which fails because it's not there(because it's on cell level).

Indeed we can have provider with same name if one is in cell level and other in node/server level. WAS admin console allows you to create providers with same name even with same scope. So we need to find a way to detect this stuff without having duplicates.

Issue Links

Activity

Hide
Janne Valkealahti added a comment -

Attached WAS-jdbc-providers.png. "DB2 UDB for iSeries (Toolbox)" is the one which fails.

Show
Janne Valkealahti added a comment - Attached WAS-jdbc-providers.png. "DB2 UDB for iSeries (Toolbox)" is the one which fails.
Hide
Janne Valkealahti added a comment -

Short term solution:
Remove the "public boolean apply(ObjectName name)" and face the fact that duplicate will fail and it's a random pool which is gonna picked up by agent.

Long term solution:
Actually use custom AIID which is not just based on name and use mbeanIdentifier as a configuration value to separate these providers during the metric collection.

I always prefer solution which actually works...

Show
Janne Valkealahti added a comment - Short term solution: Remove the "public boolean apply(ObjectName name)" and face the fact that duplicate will fail and it's a random pool which is gonna picked up by agent. Long term solution: Actually use custom AIID which is not just based on name and use mbeanIdentifier as a configuration value to separate these providers during the metric collection. I always prefer solution which actually works...
Hide
German Laullon added a comment -

"public boolean apply(ObjectName name)" Removed.
Connection Pool context on the resource name.
"mbeanIdentifier" is used to get statistics.
Summarize all pool statics for each "Connection Pool".

https://fisheye.springsource.org/changelog/hq?cs=b0c6308ce26e9764b60fa392c47a9042c608e7c1

Show
German Laullon added a comment - "public boolean apply(ObjectName name)" Removed. Connection Pool context on the resource name. "mbeanIdentifier" is used to get statistics. Summarize all pool statics for each "Connection Pool". https://fisheye.springsource.org/changelog/hq?cs=b0c6308ce26e9764b60fa392c47a9042c608e7c1
Hide
Janne Valkealahti added a comment -

I think there's 2 problems with this fix:

1. %mbeanIdentifier% is not inserted to product configuration. Plugin still discovers 'connpool' option while it's been replaced by 'mbeanIdentifier' in xml descriptor.

2. I don't know whether it was meant to use pool name to query jmx or match it to actual mbeanIdentifier(name=%mbeanIdentifier% in query). However, current solution is trying to use %mbeanIdentifier% but since that doesn't exist, metric collection fails. If you manually change 'mbeanIdentifier' to match the pool name (discovered connpool attribute value), collection works but I don't know which one is picked up since there may be duplicates(with identical pool name).

Here's dry-run snipped with metric collection by discovered values:

WebSphere 6.1 Connection Pool JDBC Pool Prepared Statement Cache Discards per Minute:
jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:prepStmtCacheDiscards:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=***********************
WebSphere 6.1 Connection Pool C:\IBM\WebSphere\AppServer\profiles\AppSrv01 jvalkealahti-e6500Node01Cell jvalkealahti-e6500Node01 server1 Samples Derby JDBC Provider (XA)
config...
product..connpool=Samples Derby JDBC Provider (XA),server.name=server1,
metric...
control..null
cprops...implementationClassName=org.apache.derby.jdbc.EmbeddedXADataSource,
rt.......null
getValue failed for metric: WebSphere 6.1 Connection Pool:jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:prepStmtCacheDiscards:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=%password%_RATE_=1m
PluginException: WebSphere:type=JDBCProvider,j2eeType=JDBCResource,name=%mbeanIdentifier%,process=server1,node=jvalkealahti-e6500Node01,* query returned 0 results
hit enter to continue
WebSphere 6.1 Connection Pool Availability:
jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:Availability:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=
getValue failed for metric: WebSphere 6.1 Connection Pool:jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:Availability:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=%password%
PluginException: WebSphere:type=JDBCProvider,j2eeType=JDBCResource,name=%mbeanIdentifier%,process=server1,node=jvalkealahti-e6500Node01,* query returned 0 results
hit enter to continue

Show
Janne Valkealahti added a comment - I think there's 2 problems with this fix: 1. %mbeanIdentifier% is not inserted to product configuration. Plugin still discovers 'connpool' option while it's been replaced by 'mbeanIdentifier' in xml descriptor. 2. I don't know whether it was meant to use pool name to query jmx or match it to actual mbeanIdentifier(name=%mbeanIdentifier% in query). However, current solution is trying to use %mbeanIdentifier% but since that doesn't exist, metric collection fails. If you manually change 'mbeanIdentifier' to match the pool name (discovered connpool attribute value), collection works but I don't know which one is picked up since there may be duplicates(with identical pool name). Here's dry-run snipped with metric collection by discovered values: WebSphere 6.1 Connection Pool JDBC Pool Prepared Statement Cache Discards per Minute: jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:prepStmtCacheDiscards:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=*********************** WebSphere 6.1 Connection Pool C:\IBM\WebSphere\AppServer\profiles\AppSrv01 jvalkealahti-e6500Node01Cell jvalkealahti-e6500Node01 server1 Samples Derby JDBC Provider (XA) config... product..connpool=Samples Derby JDBC Provider (XA),server.name=server1, metric... control..null cprops...implementationClassName=org.apache.derby.jdbc.EmbeddedXADataSource, rt.......null getValue failed for metric: WebSphere 6.1 Connection Pool:jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:prepStmtCacheDiscards:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=%password%_RATE_=1m PluginException: WebSphere:type=JDBCProvider,j2eeType=JDBCResource,name=%mbeanIdentifier%,process=server1,node=jvalkealahti-e6500Node01,* query returned 0 results hit enter to continue WebSphere 6.1 Connection Pool Availability: jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:Availability:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password= getValue failed for metric: WebSphere 6.1 Connection Pool:jvalkealahti-e6500Node01/server1/connectionPoolModule:Module=%mbeanIdentifier%:Availability:admin.host=jvalkealahti-e6500.vmware.com,admin.port=8880,username=%username%,password=%password% PluginException: WebSphere:type=JDBCProvider,j2eeType=JDBCResource,name=%mbeanIdentifier%,process=server1,node=jvalkealahti-e6500Node01,* query returned 0 results hit enter to continue
Hide
Janne Valkealahti added a comment -

If one chooses to use mbeanIdentifier in queries, I'm a bit nervous over the epoch timestamp inserted as postfix (mbeanIdentifier=.....JDBCProvider_1284588046356). Don't exactly know when websphere might change that(pool re-create vs. update).

Show
Janne Valkealahti added a comment - If one chooses to use mbeanIdentifier in queries, I'm a bit nervous over the epoch timestamp inserted as postfix (mbeanIdentifier=.....JDBCProvider_1284588046356). Don't exactly know when websphere might change that(pool re-create vs. update).
Hide
Frederic Calindas added a comment -

Verified with 4.5.0-EE_143.

Created similar test data as seen in original screenshot. See screeshot 'JDBC Providers created.jpg'

After discovery, the Connection Pool is discovered for the JDBC Provider with cell scope only. See screenshot 'JDBC Providers added.jpg'

Show
Frederic Calindas added a comment - Verified with 4.5.0-EE_143. Created similar test data as seen in original screenshot. See screeshot 'JDBC Providers created.jpg' After discovery, the Connection Pool is discovered for the JDBC Provider with cell scope only. See screenshot 'JDBC Providers added.jpg'

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:
    Last comment:
    3 years, 25 weeks, 4 days ago