Bug 1002952 - session statistics Tx* not updated any time
Summary: session statistics Tx* not updated any time
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 2.3
Hardware: All
OS: All
Target Milestone: 3.1
: ---
Assignee: Pavel Moravec
QA Contact: Petra Svobodová
Depends On:
TreeView+ depends on / blocked
Reported: 2013-08-30 10:38 UTC by Pavel Moravec
Modified: 2015-04-14 13:46 UTC (History)
3 users (show)

Fixed In Version: qpid-cpp-0.30-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-04-14 13:46:59 UTC
Target Upstream Version:

Attachments (Terms of Use)
Patch proposal (1.52 KB, patch)
2013-08-30 13:11 UTC, Pavel Moravec
no flags Details | Diff
Improved patch proposal (2.80 KB, patch)
2013-09-04 12:03 UTC, Pavel Moravec
no flags Details | Diff

System ID Priority Status Summary Last Updated
Apache JIRA QPID-5108 None None None Never
Red Hat Knowledge Base (Solution) 472513 None None None Never
Red Hat Product Errata RHEA-2015:0805 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.1 Release 2015-04-14 17:45:54 UTC

Description Pavel Moravec 2013-08-30 10:38:52 UTC
Description of problem:
Tx* counters of Session QMF object are everytime zero, regardless if transactions are/have been used or not.

Version-Release number of selected component (if applicable):
qpid-cpp-0.18-17 (also seen in 0.22)

How reproducible:

Steps to Reproduce:
echo "log-to-file=/tmp/qpidd.log" > /etc/qpidd.conf
echo "auth=no" >> /etc/qpidd.conf
echo "trace=yes" >> /etc/qpidd.conf
rm -rf /tmp/qpidd.log 
service qpidd restart
qpid-send -m 20 -a "myQueue; {create:always}" --tx 2 --rollback-frequency=50
sleep 10
grep Tx /tmp/qpidd.log | grep session

(optionally, check the the session statistics in qpid-tool)

Actual results:
2013-08-30 10:22:38 [Model] trace Mgmt delete session. id:18f9a28a-f5b0-4e9d-9fe7-dc49a1463e6a Statistics: {TxnCommits:0, TxnCount:0, TxnRejects:0, TxnStarts:0, clientCredit:0, unackedMessages:0}
2013-08-30 10:22:38 [Management] trace Deleting V2 map={_create_ts:1377850955102035092, _delete_ts:1377850955109735713, _object_id:{_agent_epoch:1, _object_name:org.apache.qpid.broker:session:18f9a28a-f5b0-4e9d-9fe7-dc49a1463e6a}, _schema_id:{_class_name:session, _hash:1aaa08d0-c118-ff78-0956-47b9ac9c6849, _package_name:org.apache.qpid.broker, _type:_data}, _update_ts:1377850955102035092, _values:{TxnCommits:0, TxnCount:0, TxnRejects:0, TxnStarts:0, attached:False, channelId:1, clientCredit:0, connectionRef:{_agent_epoch:1, _object_name:org.apache.qpid.broker:connection:}, detachedLifespan:0, name:18f9a28a-f5b0-4e9d-9fe7-dc49a1463e6a, unackedMessages:0, vhostRef:{_object_name:org.apache.qpid.broker:vhost:org.apache.qpid.broker:broker:amqp-broker,/}}}

See "TxnCommits:0, TxnCount:0, TxnRejects:0, TxnStarts:0" in both trace logs / qpid-tool

Expected results:
TxnCommits:5, TxnCount:10, TxnRejects:5, TxnStarts:0
(TxnStarts!=0 only if there is some started but not commited/rejected transaction - test case is obvious though not trivial)

Additional info:
See partially relevant bz1002605.

Comment 1 Pavel Moravec 2013-08-30 13:08:05 UTC
Correcting mis-calculations in reproducer:

qpid-send -m 20 -a "myQueue; {create:always}" --tx 2 --rollback-frequency 2

should generate:

TxnCommits:6, TxnCount:11, TxnRejects:5, TxnStarts:1

(10 transactions, every 2nd rejected, plus one extra at the end)

Comment 2 Pavel Moravec 2013-08-30 13:11:36 UTC
Created attachment 792176 [details]
Patch proposal

Patch based on 0.22-4 code as I dont suppose backport to 0.18/2.3 branch.

Guessing that TxnStarts counter stands for number of tx.select messages sent on the session, the counter can be at most one.

Guessing that TxnCount=TxnCommits+TxnRejects.

Based on that, see attached patch.

The patch does not calculate DTX transactions as I was unable to match DTX methods to the stats.

Comment 3 Pavel Moravec 2013-09-04 12:03:33 UTC
Created attachment 793641 [details]
Improved patch proposal

Based on gsim's advice, I moved the statistics update from SemanticsState to SessionState, to get rid of the re-casting issue. SemanticState just calls the SessionState methods updating the stats directly.

Comment 4 Pavel Moravec 2013-09-05 07:34:05 UTC
Commited in r1520245.

Comment 7 Petra Svobodová 2015-03-26 14:07:25 UTC
The session statistics are dynamicly updated now.

Verified on version qpid-cpp-0.30-7 on Rhel 6.6 (i686 in x86_64) and on Rhel 7.1 x86_64.


Comment 9 errata-xmlrpc 2015-04-14 13:46:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.