Report auto db purge and manual db purge statistics as UVE

Bug #1451619 reported by c mishra
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Fix Committed
Medium
c mishra
R2.20
Fix Committed
Medium
Sundaresan Rajangam
R2.21.x
Fix Committed
Medium
Sundaresan Rajangam

Bug Description

Recently we have added a feature where we auto purge database if the disk usage exceeds certain threshold.

As part of purge we delete multiple rows of database before certain time cut off.

It will be nice to report as UVE
1) How much time each purge operation took
2) If and what errors were encountered during purge.
3) How many total rows of data were deleted

Tags: analytics
c mishra (cdmishra)
Changed in juniperopenstack:
assignee: nobody → c mishra (cdmishra)
Raj Reddy (rajreddy)
Changed in juniperopenstack:
importance: Undecided → Medium
Revision history for this message
c mishra (cdmishra) wrote :

During auto purge purge stats are indeed reported.

Only thing which is not reported currently are any errors encountered during the purge.

Changed in juniperopenstack:
status: New → In Progress
c mishra (cdmishra)
Changed in juniperopenstack:
importance: Medium → Low
importance: Low → Medium
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : master

Review in progress for https://review.opencontrail.org/10867
Submitter: c mishra (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/10867
Committed: http://github.org/Juniper/contrail-controller/commit/2015613e0543fc023e9f58c486d594baa316d0cd
Submitter: Zuul
Branch: master

commit 2015613e0543fc023e9f58c486d594baa316d0cd
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
Change-Id: I68a78f6c8e120fafd771bfb84e89b06b49f3bbfd

Changed in juniperopenstack:
status: In Progress → Fix Committed
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.20

Review in progress for https://review.opencontrail.org/14697
Submitter: Sundaresan Rajangam (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.21.x

Review in progress for https://review.opencontrail.org/14698
Submitter: Sundaresan Rajangam (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/14698
Committed: http://github.org/Juniper/contrail-controller/commit/2a333c87f22d6874eb25e3d08bf949975f8a7614
Submitter: Zuul
Branch: R2.21.x

commit 2a333c87f22d6874eb25e3d08bf949975f8a7614
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
Change-Id: I68a78f6c8e120fafd771bfb84e89b06b49f3bbfd
(cherry picked from commit 2015613e0543fc023e9f58c486d594baa316d0cd)

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
(cherry picked from commit 95077da002c6a7d4d6908cf5fc92d68d97baa0b7)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/14697
Committed: http://github.org/Juniper/contrail-controller/commit/377827c56dc70d15f862079585a01ca10c3b1164
Submitter: Zuul
Branch: R2.20

commit 377827c56dc70d15f862079585a01ca10c3b1164
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
Change-Id: I68a78f6c8e120fafd771bfb84e89b06b49f3bbfd
(cherry picked from commit 2015613e0543fc023e9f58c486d594baa316d0cd)

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
(cherry picked from commit 95077da002c6a7d4d6908cf5fc92d68d97baa0b7)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.