#5587 closed defect (complete)

Implement main support for Shared Lease Storage Stats for PostgreSQL

Reported by: tmark Owned by: tmark
Priority: medium Milestone: Kea1.4
Component: database-pgsql 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 PostgreSQL:

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 (10)

comment:1 Changed 15 months ago by tmark

  • Milestone changed from Kea-proposed to Kea1.4

comment:2 Changed 14 months ago by tmark

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

comment:3 Changed 14 months ago by tmark

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

PostgreSQL shared lease stats are implemented and ready for review.

These changes are internal and thus do not require a ChangeLog.

comment:4 Changed 14 months ago by marcin

  • Owner changed from UnAssigned to marcin

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

  • Owner changed from marcin to tmark

I reviewed commit b0bea19c4867e1aaeee0629f75066f005f119a7e.

Changes are very similar to MySQL and so there is not much more to say about it beyond the following little error I found.

src/bin/admin/tests/pgsql_tests.sh.in
pgsql_lease_stat_upgrade_test: If I am not mistaken, the comment in line 671 should say:

# Ok, we have a 2.0 database with leases. Let's upgrade it to 4.0

but it says:

# Ok, we have a 4.0 database with leases. Let's upgrade it to 6.0

Looks like copy-paste error from MySQL.

Otherwise it looks fine and can be merged.

You're pointing out that ChangeLog is not required because this is an internal change. On reflection I think that all of these changes (including MySQL an CQL) may actually deserve some ChangeLog. First of all, this is marked as a defect and people did complain about this in the past. So, correcting the defect is a user visible change obviously. Another point is that it changes the schemas of the existing databases, forcing people to upgrade their instances (even though there are also other changes in 1.4 that contribute to the fact that people need to upgrade).

comment:6 in reply to: ↑ 5 Changed 14 months ago by tmark

Replying to marcin:

I reviewed commit b0bea19c4867e1aaeee0629f75066f005f119a7e.

Changes are very similar to MySQL and so there is not much more to say about it beyond the following little error I found.

src/bin/admin/tests/pgsql_tests.sh.in
pgsql_lease_stat_upgrade_test: If I am not mistaken, the comment in line 671 should say:

# Ok, we have a 2.0 database with leases. Let's upgrade it to 4.0

but it says:

# Ok, we have a 4.0 database with leases. Let's upgrade it to 6.0

Looks like copy-paste error from MySQL.

Got it thanks.

Otherwise it looks fine and can be merged.

You're pointing out that ChangeLog is not required because this is an internal change. On reflection I think that all of these changes (including MySQL an CQL) may actually deserve some ChangeLog. First of all, this is marked as a defect and people did complain about this in the past. So, correcting the defect is a user visible change obviously. Another point is that it changes the schemas of the existing databases, forcing people to upgrade their instances (even though there are also other changes in 1.4 that contribute to the fact that people need to upgrade).

So this is why on 5586 that my remark about a ChangeLog? entry was actually a question. That's what "?" means. ;)

How do these look?

13xx.   [bug]       tmark
    The PostgreSQL schema was expanded to include two new tables:
    lease4-stat and lease6-stat and triggers to update them as leases
    are modified.  This resolves an issue accurate lease statistics in 
    multi-server deployments using a common PostgreSQL lease database 
    could not determined. The new statistics will be accessible via a new
    Hooks library, being developed for Kea 1.4 under #5589. 
    (Trac #5587, git TBD)

13xx.   [bug]       tmark
    The MySQL schema was expanded to include two new tables:
    lease4-stat and lease6-stat and triggers to update them as leases
    are modified.  This resolves an issue accurate lease statistics in
    multi-server deployments using a common MySQL lease database
    could not determined. The new statistics will be accessible via a new
    Hooks library, being developed for Kea 1.4 under #5589. 
    (Trac #5586, git a070c327668c10de3b28f5e249f91d6d16a97ff5)

comment:7 Changed 14 months ago by tmark

  • Owner changed from tmark to marcin

comment:8 Changed 14 months ago by tmark

  • Owner changed from marcin to tmark

comment:9 Changed 14 months ago by tmark

After jabbering with Marcin the ChangeLog? text will read:

13xx.   [bug]       tmark
    The PostgreSQL schema was expanded to include two new tables:
    lease4-stat and lease6-stat and triggers to update them as leases
    are modified. This resolves an issue in deployements, where multiple
    Kea servers share a common PostgreSQL lease database, which made
    it difficult to obtain accurate lease statistics. Since these statistics
    are now tracked by the database, they do not have to be recalculated at
    startup or following reconfiguration. This may result in less
    processing overhead during these events. The new statistics will be
    accessible via a new Hooks library, being developed for Kea 1.4
    under #5589.
    (Trac #5587, git TBD)

13xx.   [bug]       tmark
    The MySQL schema was expanded to include two new tables:
    lease4-stat and lease6-stat and triggers to update them as leases
    are modified. This resolves an issue in deployements, where multiple
    Kea servers share a common MySQL lease database, which made it difficult
    to obtain accurate lease statistics. Since these statistics are now
    tracked by the database, they do not have to be recalculated at startup
    or following reconfiguration. This may result in less processing overhead
    during these events. The new statistics will be accessible via a new Hooks
    library, being developed for Kea 1.4 under #5589.
    (Trac #5586, git a070c327668c10de3b28f5e249f91d6d16a97ff5)

comment:10 Changed 14 months ago by tmark

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

Changes merged with git# 36a0160de0df7789eea224954717be05c08638b7

Added ChangeLog entries 1395 and 1396.

Ticket is complete.

Note: See TracTickets for help on using tickets.