The purge function always expects composite key and tries to extract
the first element (timestamp) from the key.
But for MESSAGE_TABLE_TIMESTAMP, the key is of type integer
and hence it raises exception. Side-effect of this exception:
data from the table MESSAGE_TABLE_TIMESTAMP not purged.
2) object identity check fails for table.
=> if (table is MESSAGE_TABLE_SOURCE):
The above check always fails due to object id mismatch.
Therefore, data is not purged from the MessageTable.
Replaced object identity check with equality check.
Change-Id: I51d619ac5275acf737094b7cdf36bb3d462fcf81
Closes-Bug: #1487966
(cherry picked from commit 95077da002c6a7d4d6908cf5fc92d68d97baa0b7)
Reviewed: https:/ /review. opencontrail. org/14697 github. org/Juniper/ contrail- controller/ commit/ 377827c56dc70d1 5f862079585a01c a10c3b1164
Committed: http://
Submitter: Zuul
Branch: R2.20
commit 377827c56dc70d1 5f862079585a01c a10c3b1164
Author: Chandan Mishra <email address hidden>
Date: Tue May 26 14:12:48 2015 -0700
This commit does two things:
a) Modifies database purge uve to include error/warning strings related to the
last purge operation.
b) Make sure all analytics start time are same when the system first gets started.
Closes-Bug: 1451619 afd771bfb84e89b 06b49f3bbfd 23e9f58c486d594 baa316d0cd)
Change-Id: I68a78f6c8e120f
(cherry picked from commit 2015613e0543fc0
Fix database purge code in analytics-api
This patch fixes the following issues in db_purge() method.
1) The key type for MESSAGE_ TABLE_TIMESTAMP is different from the
other message index tables.
pycassaShell output:
>>> MESSAGETABLETIM ESTAMP. key_validation_ class
'IntegerType'
>>> MESSAGETABLESOU RCE.key_ validation_ class IntegerType, UTF8Type)'
'CompositeType(
>>> MESSAGETABLEMES SAGETYPE. key_validation_ class IntegerType, UTF8Type)'
'CompositeType(
The purge function always expects composite key and tries to extract TABLE_TIMESTAMP , the key is of type integer TABLE_TIMESTAMP not purged.
the first element (timestamp) from the key.
But for MESSAGE_
and hence it raises exception. Side-effect of this exception:
data from the table MESSAGE_
2) object identity check fails for table. TABLE_SOURCE) :
=> if (table is MESSAGE_
The above check always fails due to object id mismatch.
Therefore, data is not purged from the MessageTable.
Replaced object identity check with equality check.
Change-Id: I51d619ac5275ac f737094b7cdf36b b3d462fcf81 4d6908cf5fc92d6 8d97baa0b7)
Closes-Bug: #1487966
(cherry picked from commit 95077da002c6a7d