Opened 7 years ago

Closed 7 years ago

#1982 closed defect (fixed)

sqlite database upgrade during make install

Reported by: cas Owned by: jinmei
Priority: medium Milestone: Sprint-20120612
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 4 Add Hours to Ticket: 0
Total Hours: 3.3 Internal?: no

Description

I'm trying to build new RPM packages for BIND 10 20120517.

Even though I'm installing into a sandbox directory (with make DESTDIR=/sandbox install), the makeinstall script stops with an error that my sqlite DB in /usr/local/var/bind10-devel/zone.sqlite is of version 1 and I need to upgrade it to version 2. That file is not in the sandbox and should be of no concern when building packages.

I would prefer if the upgrade check (and maybe even the automatic upgrade of the database) is done when BIND 10 is started, not during the install script.

The "install" step is run during installation from source. The upgrade check (and the upgrade) should also be done after installing from binary package, or after the user has restored a backup of an old database.

It is therefore easier to handle for the user of BIND 10 if the database upgrade is done during the start of the BIND 10 system (for example the "Boss of BIND" could make this check).

Subtickets

Attachments (1)

makefile.diff (1.3 KB) - added by jinmei 7 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by cas

the Men & Mice Central component also uses a SQLite database and has a similar challenge to upgrade the database.

The Men & Mice Central process check the database version on every startup, and it contains the upgrade code for every database revision there was ever in the history of this product. So it can upgrade databases even if the user has jumped versions. This scheme has been very stable and reduced the amount of support issues with the database system for Men & Mice (since we migrated to SQlite in 2004).

comment:2 in reply to: ↑ description Changed 7 years ago by jinmei

Replying to cas:

I'm trying to build new RPM packages for BIND 10 20120517.

Even though I'm installing into a sandbox directory (with make DESTDIR=/sandbox install), the makeinstall script stops with an error that my sqlite DB in /usr/local/var/bind10-devel/zone.sqlite is of version 1 and I need to upgrade it to version 2. That file is not in the sandbox and should be of no concern when building packages.

I would prefer if the upgrade check (and maybe even the automatic upgrade of the database) is done when BIND 10 is started, not during the install script.

We do have a plan (or at least an idea) to make the check happen at
start up time: #1842

Regarding the installation time check, I personally think it's still
useful. If a careless user just overrides the system with a new
version that requires incompatible DB schema and restarts BIND 10, the
service will effectively stop until the DB is upgraded, regardless
whether the user has to do it by hand or some start up part of BIND 10
does it automatically. It's probably not ideal if that takes time
(e.g., tens of minutes). "Better safe than sorry".

But I agree that the current behavior where it checks the installed DB
file just to make an independent package is bad, and that we should at least
solve that problem sooner.

Last edited 7 years ago by jinmei (previous) (diff)

comment:3 Changed 7 years ago by jinmei

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:4 Changed 7 years ago by jinmei

  • Type changed from enhancement to defect

(changing it to "defect")

comment:5 Changed 7 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20120612

comment:6 Changed 7 years ago by jinmei

I'm attaching a proposed diff for this. I confirmed that it should
solve the reported problem by actually running it.

Please review (it's small).

Proposed changelog entry:

445.?	[bug]*		jinmei
	The pre-install check for older SQLite3 DB now refers to the DB
	file with the prefix of DESTDIR.  This ensures that 'make install'
	with specific DESTDIR works regardless of the version of the DB
	file installed in the default path.
	(Trac #1982, git TBD)

Changed 7 years ago by jinmei

comment:7 Changed 7 years ago by jinmei

  • Status changed from new to reviewing

comment:8 Changed 7 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:9 follow-up: Changed 7 years ago by vorner

  • Owner changed from vorner to jinmei

Hello

I think it is OK and should be merged. But should we check with the reporter before closing the ticket? What was our consensus on this?

Thank you

comment:10 Changed 7 years ago by vorner

  • Total Hours changed from 0 to 0.42

comment:11 in reply to: ↑ 9 ; follow-up: Changed 7 years ago by jinmei

Replying to vorner:

I think it is OK and should be merged. But should we check with the reporter before closing the ticket? What was our consensus on this?

I've sent an email directly to the reporter:

We're going to commit a fix to the immediate issue that 'make install'
with DESTDIR failed, while still keeping the upgrade check as part of
install.

(Aside from whether it's reasonable to do the check during install)
the original ticket also suggested doing the check at run time, but I
think it's not a trivial task and it will be longer term fodder.

So my suggesting is to close the ticket with the immediate fix.  If
you want we can create a separate ticket for the longer term issues.
If I misunderstand it fundamentally and the proposed fix doesn't even
solve your immediate problem of packaging, please let me know.

I'll wait for a few days, and if I get a confirmation or the waiting
period is over, I'll merge the diff and close the ticket.

comment:12 in reply to: ↑ 11 Changed 7 years ago by jinmei

Replying to jinmei:

I'll wait for a few days, and if I get a confirmation or the waiting
period is over, I'll merge the diff and close the ticket.

I've got a confirmation, patch committed, closing.

comment:13 Changed 7 years ago by jinmei

  • Resolution set to fixed
  • Status changed from reviewing to closed
  • Total Hours changed from 0.42 to 3.3
Note: See TracTickets for help on using tickets.