← Back to team overview

launchpad-dev team mailing list archive

Re: Archaeology questions

 

On Sat, 2011-02-19 at 10:02 -0500, Curtis Hovey wrote:
> [snip]
> 
> > 3. canonical.lp is "deprecated", but it doesn't say what it's
> > deprecated in favour of. Lots of code uses initZopeless from that
> > module, so I'd guess that it's in favour of
> > c.database.sqlbase.ZopelessTransactionManager. Bug 484033 doesn't
> > really add much more information.
> 
> I too have asked this question. Many of the features that were in it
> were whittled away. Some parts just becoming unneeded, or parts were
> moved. I know webapp got some parts. I think the issue here is that
> canonical.lp does not need to move, it needs to be disassembled.

I've tried to destroy this a couple of times over the last 18 months,
but it is so entangled with so many things that I gave up. But I looked
at this again on Friday night, after clarifying a few things with
Launchpadders from ancient times.

Both initZopeless and ZopelessTransactionManager are deprecated.
Everything can just use the global transaction.commit(),
transaction.abort(), etc. Nowadays ZTM just serves to override the DB
config. This deprecation is why I have not moved canonical.lp; as Curtis
says it needs to instead be destroyed.

The config can be overridden in three ways: scripts passing a dbuser
into initZopeless, scripts and tests calling switchDbUser... and the
LP_DBUSER, LP_DBHOST and LP_DBNAME environment variables. The
environment variables are deprecated, but probably still used by some
obscure database management scripts. Perhaps we should drop the envvars
and add configs for all the scripts that work on custom DBs. Pushing
configs may cause issues in LaunchpadZopelessLayer tests, but they
shouldn't be too hard to resolve.

switchDbUser could be a bit of a problem, or at least a little
confusing. It will require us to push a config overlay whenever a switch
is requested. This, due to lazr.config overlays behaving as a stack, may
interact oddly with tests that already push custom overlays. There may
be a little fallout from this.

Writing this email has made me think through some of the roadblocks that
I discovered on Friday. I think now that it is doable, and might even
try it later.

There is also the issue of Zopeless email sending. When ZTM is
installed, email transmission violates transactions. archiveuploader
relies on this behaviour for sending rejection messages; whatever
replaces initZopeless should probably also activate Zopeless-like email
sending, at least until we can work out exactly what requires it.

William.

Attachment: signature.asc
Description: This is a digitally signed message part


References