-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: >>> MESSAGETABLETIMESTAMP.key_validation_class 'IntegerType' >>> MESSAGETABLESOURCE.key_validation_class 'CompositeType(IntegerType, UTF8Type)' >>> MESSAGETABLEMESSAGETYPE.key_validation_class 'CompositeType(IntegerType, UTF8Type)' 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
- Loading branch information
Sundaresan Rajangam
committed
Oct 27, 2015
1 parent
444742c
commit 95077da
Showing
3 changed files
with
63 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters