Opened 3 years ago

Closed 3 years ago

#4562 closed enhancement (complete)

Host Reservations: update kea-admin to support upgrade MySQL schema from 4.1 to 4.2

Reported by: marcin Owned by: marcin
Priority: medium Milestone: Kea1.1
Component: host-reservations Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 2 Add Hours to Ticket: 1
Total Hours: 4 Internal?: no

Description

We deferred creation of the upgrade script between schema 4.1 and 4.2 because we have been making constant changes to the schema as the host reservations implementation was progressing.

My estimate for this work is 0.5d.

Subtickets

Change History (7)

comment:1 Changed 3 years ago by marcin

  • Milestone changed from Kea-proposed to Kea1.1
  • Owner set to marcin
  • Status changed from new to accepted

comment:2 Changed 3 years ago by marcin

  • Add Hours to Ticket changed from 0 to 3
  • Estimated Difficulty changed from 0.5 to 2
  • Owner changed from marcin to UnAssigned
  • Status changed from accepted to reviewing
  • Total Hours changed from 0 to 3

Updated MySQL schema to 5.0. Added version 5.0 specific checks in the tests. Also, updated tests for PostgreSQL to include fixed DHCPv4 message fields: next server, server hostname and boot file name.

Many tests used invalid order of parameters in assert_eq checks. I corrected the order in both Postgres and MySQL tests.

There was a little error in doxygen documentation about setting up PostgreSQL database for unit tests. I fixed that.

Please review.

Proposed ChangeLog:

MySQL database schema updated to version 5.0.

comment:3 Changed 3 years ago by tmark

  • Owner changed from UnAssigned to tmark

comment:4 follow-up: Changed 3 years ago by tmark

  • Add Hours to Ticket changed from 3 to 1
  • Owner changed from tmark to marcin
  • Total Hours changed from 3 to 4

The changes look ok but there's a problem here. Both MySQL schema 4.2 and PostgreSQL Schema 3.0 (original) have been available during 1.1 development for quite some time. The upgrade scripts do not account for anyone possibly having them already. Anyone with a 4.2 or 3.0 (original) schema cannot upgrade their database. Either we state this in the release notes or we actually upgrade from 4.1 to 4.2 and 4.2 to 5.0 for MySQL; and for PosgresSQL from 3.0 to 3.1. While it is more work, I think we should do the latter.

Keep in mind these three columns were added expressly at eBays request and represent a disinct change.

Also, why did you choose to go from 4.2 to 5.0? I don't think adding 3 columns to one table equates to a major change do you? Why not 4.3?

comment:5 in reply to: ↑ 4 Changed 3 years ago by marcin

  • Owner changed from marcin to tmark

Replying to tmark:

The changes look ok but there's a problem here. Both MySQL schema 4.2 and PostgreSQL Schema 3.0 (original) have been available during 1.1 development for quite some time. The upgrade scripts do not account for anyone possibly having them already. Anyone with a 4.2 or 3.0 (original) schema cannot upgrade their database. Either we state this in the release notes or we actually upgrade from 4.1 to 4.2 and 4.2 to 5.0 for MySQL; and for PosgresSQL from 3.0 to 3.1. While it is more work, I think we should do the latter.

Keep in mind these three columns were added expressly at eBays request and represent a disinct change.

Also, why did you choose to go from 4.2 to 5.0? I don't think adding 3 columns to one table equates to a major change do you? Why not 4.3?

I disagree. We make no promises for the software between releases to be fully working or be compatible with previous or next version of Kea. Even though we were using version 4.2 and 3.0 throughout the whole Kea 1.1 development cycle, you can't even tell what schema was marked with those versions. In MySQL we were constantly adding new columns, tables and constraints but the schema had been given the version number of 4.2 on the very beginning and we didn't modify that version number when we applied the updates. So, some people may have database of 4.2 with some tables/columns which other users of 4.2 don't have etc. In that case, it doesn't make a lot of sense to try to support users which elected to use/test some intermediate version of Kea from git, because we have no way to support them. I also don't believe that these users used intermediate version of Kea in production. They most likely used it for testing and they can easily re-create their databases.

As for the 4.2 vs 5.0? I think we have made major changes - we added new columns, we created new tables and changed the types of some of the existing columns. These are pretty major changes. If this is not a major change, I don't know what kind of change that should be to be called major. Note that new Kea version will not work correctly with the old schema, as the old schema is missing some of the columns, e.g in hosts table, and queries and statements wouldn't match.

comment:6 Changed 3 years ago by tmark

  • Owner changed from tmark to marcin

I won't argue the point. Merge.

comment:7 Changed 3 years ago by marcin

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

Merged to master. Closing.

Note: See TracTickets for help on using tickets.