Bug 1002952 - session statistics Tx* not updated any time
session statistics Tx* not updated any time
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
2.3
All All
medium Severity medium
: 3.1
: ---
Assigned To: Pavel Moravec
Petra Svobodová
: EasyFix, Patch, TestCaseProvided
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-30 06:38 EDT by Pavel Moravec
Modified: 2015-04-14 09:46 EDT (History)
3 users (show)

See Also:
Fixed In Version: qpid-cpp-0.30-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-04-14 09:46:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 472513 None None None Never
Apache JIRA QPID-5108 None None None Never

  None (edit)
Description Pavel Moravec 2013-08-30 06:38:52 EDT
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:
100%


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:127.0.0.1:5672-127.0.0.1:52255}, 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 09:08:05 EDT
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 09:11:36 EDT
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 08:03:33 EDT
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 03:34:05 EDT
Commited in r1520245.
Comment 7 Petra Svobodová 2015-03-26 10:07:25 EDT
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.

--VERIFIED
Comment 9 errata-xmlrpc 2015-04-14 09:46:59 EDT
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.

https://rhn.redhat.com/errata/RHEA-2015-0805.html

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