[MacPorts] #48327: malformed registry

MacPorts noreply at macports.org
Wed Jul 15 09:10:58 PDT 2015


#48327: malformed registry
--------------------------+--------------------------------
  Reporter:  rjvbertin@…  |      Owner:  macports-tickets@…
      Type:  defect       |     Status:  closed
  Priority:  Normal       |  Milestone:
 Component:  base         |    Version:
Resolution:  invalid      |   Keywords:
      Port:               |
--------------------------+--------------------------------

Comment (by rjvbertin@…):

 Replying to [comment:5 cal@…]:
 > Replying to [comment:4 rjvbertin@…]:

 > > Yes, though I've come to expect issues with sqlite.
 >
 > SQLite is actually a very-well tested piece of software.

 I'm not claiming the contrary, but from what I understand it's not the
 best choice for all kinds of applications.

 > Really? IIRC phpbb uses MySQL.

 As I said, I'm not sure. We're also talking about several years in the
 past (and a not-too-cutting-edge phpbb version at the time).

 > I'd do it in reg_attach/reg_detach; reg_open/reg_close don't deal with
 the actual registry database file, but just setup the connection to SQLite
 and initialize a few things we need in SQLite. I don't think this backup
 mechanism should be a way to provide the feature set that should be
 provided by transactions, though. I'd rather have a couple of backup
 copies that a user can manually revert to if things stopped working
 correctly. Maybe use a timestamp in the target filename? Of course, we'd
 need some kind of cleanup, because copying on each open of the registry
 can generate a lot of data very quickly.

 No, AFAIC it's only to provide a safety against corruption due to
 unforeseen termination. What I think I'll do is create a `registry.db.bak`
 if the file doesn't already exist and remember if I did. Then, upon
 successful termination, in reg_detach, that file will be moved to
 `registry.db.1.bak`, after a backup rotation over a suitable number of
 files (5? 10?), but only if `registry.db.bak` was actually created this
 time around.
 If `registry.db.bak` exists in reg_attach, a warning will be printed (also
 in reg_detach) and it will be left alone.

 It would be nice in reg_detach to do the rotation and cleanup regardless
 of whether `registry.db.bak` was created this time around, but is there a
 way of knowing whether a sufficient number of sufficiently different db
 operations were carried out to be sure that the current `registry.db` is
 indeed in good shape? If not, it's probably best to let the user run
 checks to verify this (possibly renaming `registry.db.bak` to
 something/someplace of his/er own choice).

 We could consider compressing the `.N.bak` files.

-- 
Ticket URL: <https://trac.macports.org/ticket/48327#comment:6>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list