Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#3969 closed task (complete)

Provide upgrade scripts to the 2.0 PostgreSQL schema version

Reported by: marcin Owned by: tmark
Priority: high Milestone: Kea1.0-beta
Component: dhcp Version: git
Keywords: expiration Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 8 Internal?: no

Description (last modified by tmark)

See Design for the details.

Subtickets

Change History (10)

comment:1 Changed 4 years ago by tmark

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

comment:2 Changed 4 years ago by tmark

  • Description modified (diff)
  • Summary changed from Provide upgrade scripts to the 4.0 PostgreSQL schema version to Provide upgrade scripts to the 2.0 PostgreSQL schema version

Upgrade adds state column to both lease tables, the state table,
and the lease dump functions:

src/bin/admin/scripts/pgsql/upgrade_1.0_to_2.0.sh -

new script for upgrading postgres schema

src/bin/admin/tests/dhcpdb_create_1.0.pgsql

new sql script for creating 1.0 schema db

configure.ac

added entry for new upgrade script

src/bin/admin/kea-admin.in

pgsql_upgrade() - modified to set Postgres password env variable
and pass in remaining args as psql expects them

src/bin/admin/scripts/pgsql/Makefile.am

added entry for new upgrade script

src/bin/admin/tests/Makefile.am

added entry for 1.0 schema script

src/bin/admin/tests/pgsql_tests.sh.in

pgsql_upgrade_test() - revamped now that Postgres actually
has its first upgrade script.

I suggest the following ChangeLog entry:

1xxx.   [func]      tmark
    kea-admin now supports upgrading from Postgres schema version 
    1.0 to 2.0.  Schema 2.0 includes support for lease expiration
    and reclaimation.
    (Trac #3969, git TBD)

comment:3 Changed 4 years ago by tmark

  • Owner changed from tmark to UnAssigned
  • Status changed from assigned to reviewing
  • Total Hours changed from 0 to 6

comment:4 Changed 4 years ago by marcin

  • Owner changed from UnAssigned to marcin

comment:5 follow-up: Changed 4 years ago by marcin

  • Owner changed from marcin to tmark

Reviewed commit 49b0bac2763bd50e795ee21a2b922c8046f08908

This change is straight forward. I found only minor issues.

src/bin/admin/scripts/pgsql/upgrade_1.0_to_2.0.sh.in
Please create .gitignore in this directory and include the upgrade_1.0_to_2.0.sh in it.

src/bin/admin/tests/dhcpdb_create_1.0.pgsql
At the top of this script there are instructions how to use it to initialize the database. There are two approaches described: use psql, or log in to the Postgres and execute @dhcpdb_create.pgsql. That's ok, but I wonder if this description should also be extended to say that this script is primarly used by the kea-admin?

Note that the MySQL creation script mentions kea-admin briefly.

I am not sure why the comment below "lease6_types" says: "We start at 0.1...". Shouldn't it be 1.0?

src/bin/admin/tests/pgsql_tests.sh.in

Typo "scheme".

Changelog looks ok.

comment:6 in reply to: ↑ 5 Changed 4 years ago by tmark

Replying to marcin:

Reviewed commit 49b0bac2763bd50e795ee21a2b922c8046f08908

This change is straight forward. I found only minor issues.

src/bin/admin/scripts/pgsql/upgrade_1.0_to_2.0.sh.in
Please create .gitignore in this directory and include the upgrade_1.0_to_2.0.sh in it.

Done

src/bin/admin/tests/dhcpdb_create_1.0.pgsql
At the top of this script there are instructions how to use it to initialize the database. There are two approaches described: use psql, or log in to the Postgres and execute @dhcpdb_create.pgsql. That's ok, but I wonder if this description should also be extended to say that this script is primarly used by the kea-admin?

Note that the MySQL creation script mentions kea-admin briefly.

Added some text explaining that the script is being used for tests. I did not mention kea-admin. I suspect the MySQL text is just left over from it being a copy of the 1.0
production script.

I am not sure why the comment below "lease6_types" says: "We start at 0.1...". Shouldn't it be 1.0?

Done.

src/bin/admin/tests/pgsql_tests.sh.in

Typo "scheme".

Got it.


Changelog looks ok.

comment:7 Changed 4 years ago by tmark

  • Owner changed from tmark to marcin

comment:8 Changed 4 years ago by marcin

  • Owner changed from marcin to tmark

All ok. Please merge.

comment:9 Changed 4 years ago by tmark

  • Resolution set to complete
  • Status changed from reviewing to closed
  • Total Hours changed from 6 to 8

Changes commited with 8fde70c1b63b5a2646688290b1d0cf53f4c964ad

Added ChangeLog entry 1036

Ticket is complete.

comment:10 Changed 4 years ago by tomek

  • Milestone changed from Kea1.0 to Kea1.0-beta

Milestone renamed

Note: See TracTickets for help on using tickets.