#5588 closed defect (complete)

Implement main support for Shared Lease Storage Stats for Cassandra

Reported by: tmark Owned by: tmark
Priority: medium Milestone: Kea1.4
Component: database-cassandra Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket: Shared Lease Statistics
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Implement the changes described in section 4.1 of the Shared Lease Stats
Design (http://kea.isc.org/wiki/SharedLeaseStorageStats) for Cassandra:

4.1.1 New Tables and Triggers
4.1.2 Add new SQL queries to LeaseMgr? derivations
4.1.3 Extend the LeaseStatsQuery? class and derivations
4.1.4 Overload !LeaseMgr::startLeaseStatsQuery<4/6>

(Depends on #5586)

Subtickets

Change History (9)

comment:1 Changed 19 months ago by tmark

  • Milestone changed from Kea-proposed to Kea1.4

comment:2 Changed 18 months ago by tmark

  • Owner set to tmark
  • Status changed from new to assigned

comment:3 Changed 18 months ago by tmark

  • Owner changed from tmark to UnAssigned
  • Status changed from assigned to reviewing

Researching Cassandra triggers revealed the following:

  1. Triggers are written in Java using an API provided by Cassandra
  2. There are compiled into JAR files
  3. The JAR files are placed in a Cassandra installation directory so they

are automatically loaded upon start up

I was unable to locate meaningful doc on the trigger API. There are some examples but without any explanation, so to the newbie CQLer they aren't real helpful. Implementing triggers for CQL would introduce new dependencies and complexities into our build and installation, never mind the learning curve required to even write them. All of which push this past the 1.4 time frame to attempt.

So, with Tomek's approval, I have implemented the alternative approach of calculate-on-demand for shared lease stats for Cassandra. In other words, rather than getting the stat values via new stat tables populated by triggers, I added new SQL statements that support calculating per subnet or subnet-range.

Ticket is ready for review.

comment:4 Changed 17 months ago by marcin

  • Owner changed from UnAssigned to marcin

comment:5 follow-up: Changed 17 months ago by marcin

  • Owner changed from marcin to tmark

I reviewed the commit 83318b90260bcd93bf9f0164706501895c1f9e99.

The code looks good. One question I'd have is whether it would be more efficient to use SELECT COUNT(*) ..... instead of retrieving leases and count them locally?

Also, you probably need a ChangeLog entry similar to this that you applied for MySQL and Postgres.

comment:6 Changed 17 months ago by marcin

Oh, I forgot that I made minor corrections in the doxygen. Please pull.

comment:7 in reply to: ↑ 5 Changed 17 months ago by tmark

  • Owner changed from tmark to marcin

Replying to marcin:

I reviewed the commit 83318b90260bcd93bf9f0164706501895c1f9e99.

The code looks good. One question I'd have is whether it would be more efficient to use SELECT COUNT(*) ..... instead of retrieving leases and count them locally?

As discussed on #5487, aggregation in Cassandra is complicated:

"Cassandra, however, restricts the use of aggregation and ordering to being based on the partition key (i.e. component of the primary key). The stems from Cassandra's distributed data model. If data is spread among many nodes, aggregating on columns that are not used to partition data is problematic, as one needs the entire "table" content to do it properly."

Also, you probably need a ChangeLog entry similar to this that you applied for MySQL and Postgres.

How's this:

13xx.   [func]      tmark
    Support for fetching lease allocation statistics by subnet-id 
    or subnet-id range has been added to the Cassandra back end. This
    allows it to be used in conjunction with the Stat Cmds hooks 
    library commands for fetching shared lease statistics.
    (Trac #5588, git TBD)

comment:8 Changed 17 months ago by marcin

  • Owner changed from marcin to tmark

You're ready to go both with merging and the ChangeLog.

comment:9 Changed 17 months ago by tmark

  • Resolution set to complete
  • Status changed from reviewing to closed

merged with git# 3fcfefdea5ac838936c2109ecbbbc32eabc8fdba
Added ChangeLog 1399.

ticket is complete.

Note: See TracTickets for help on using tickets.