[01:02] hey spiv [01:02] how's it going? [02:20] kiko: Hey. Pretty good. [02:21] but pretty laggy. [02:21] Once I start waking up ;) [02:21] :) [02:21] any news on the sqlobject cache scare? :) [02:21] carlos's issue? [02:21] yes. or rather, YOUR issue. :) [02:22] I meant the one he encountered, rather than owned ;) [02:22] I was being cheeky [02:27] It's real problem, but I don't know what the solution is yet. [02:28] I know enough about it to write a test case for it. [02:28] There's another problem I'm aware of that may be related. [02:29] what does the good ian bicking say of it? [02:29] Overall, there's too many layers involved. SQLObject does connection pooling and object caching, sqlos hacks those, we hack those a little bit more... [02:30] it's not necessarily in the sqlobject layer, then? [02:30] ugh [02:30] My gut feeling is it should be about 5x simpler. [02:30] my gut feeling is that any tectonic movements there are going to delay us significantly. [02:30] Well, I think SQLObject's abstractions for connection management are partly to blame, in a design sense.... [02:31] because that means that sqlos needs to build its own stuff, rather than work with SQLObject. [02:31] But I agree. [02:31] I don't want to do open-heart surgery on this stuff, because that will take time. [02:31] that's what I feel as well [02:32] but we need to get this resolved once and for all [02:32] so how about you invest some serious hours into getting down into understanding the issues [02:32] get some testcases going [02:32] I wish I could be confident that fixing these latest issues will be "once and for all"... it's been whack-a-mole so far. [02:32] if I can help in any way, perhaps waving sidnei into the rink if it feels good to you [02:32] yes. [02:33] is nobody else using sqlos/sqlobject and the latest set of hacks on top of it? [02:33] Well, certainly no-one else is using sqlos + initZopeless (i.e. the same SQLObject classes inside and outside of Zope). [02:34] is that where the problem comes from? [02:34] changes being done "behind zope's back"? [02:34] which happens because of the po importd? === stub [~stub@dsl-246.248.240.220.dsl.comindico.com.au] has joined #launchpad [02:34] More generally, changes being done behind the back of SQLObject in a particular process. [02:35] can you elaborate in 3 lines? [02:35] Actually, I'm not certain that that's what carlos's problem is, I want to investigate to be sure. [02:36] But ddaa has hit that with importd, I've hacked around it for now. [02:37] by forcing a cache refresh at critical points? [02:37] So, for some reason doing a commit (or an abort) via the proper high-level mechanisms, at least in initZopeless, isn't sufficient to make db updates from other processes visible. [02:37] kiko: example: when I reload buildbot, I abort the current transaction and do a select() in sourcesource to catch changes made from lauchpad. [02:37] It used to work. [02:37] In that case, it appears that it's not the cache, but the actual connection objects themselves that need resetting. [02:38] I seriously suspect that's a regression which was introduced by the sqlos commit/abort fix. [02:38] (there's no cache issues -- these objects are new, and so aren't in the cache yet) [02:38] connection cache? [02:38] But I was not able to test that theory. [02:38] (lack of time) [02:39] carlos's problem seems to be slightly different, but I think it may be related, at least in a design sense. [02:39] In his case, clearing the cache is sufficient, no need to muck about with the actual connections. [02:40] kiko: Btw, thanks for asking about this. Explaining things out-loud does help clarify my own thoughts :) [02:40] talking is good. [02:40] so tell me more about ddaa's issue. [02:41] so it doesn't seem to be the object cache, but the connection isn't seeing an updated view of the database? [02:41] Correct. [02:41] yup [02:41] spiv: in case you missed that, _it used to work_ [02:41] The workaround is to reach behind sqlobject's back, get the actual low-level psycopg connection object, and to a .rollback and a .begin on it. [02:41] ddaa: I saw :) [02:42] Would this be because a new transaction is being started as soon as the last one is committed, and transaction isolation not letting you see DB changes after that occurs? [02:43] stub: That's my current hypothesis, yes. [02:44] spiv: Do you have a plan to progress, or do you want mine? === ddaa --> sleep [02:45] stub: I've already heard yours, I think? Close/re-open the connections, let psycopg's connection pooling take care of it. I like that plan. [02:46] Thats pretty much it. SQLOS's connection descriptor will probably even take care of reopening the connection for you. [02:47] Right. [02:49] Was there any *reason* the librarian refuses to store the same file with the same filename but different mime-types? Or is that just the way it happened? [02:50] it's at least interesting [02:50] It's currently just the way it happened, mainly. [02:50] The minor advantage is that a file content id + filename is sufficient to know the mime type. [02:50] Which makes the URLs slightly simpler. [02:51] Hmm.... we should only ever need to use filealiases though. I'll add a low priority bug on this - the use case is where somebody uploads a file with the wrong mime type and tries to correct this situation by uploading again. [02:52] Hmm, yeah. [02:52] they'd need to use a new ID here [02:53] I've suspected it was a bad restriction, but I couldn't think of a use-case, so called YAGNI on myself before fixing it. [02:53] But yeah, that might happen. [02:53] kiko: Indeed. The upload should work and we get a new filealias pointing to the same filecontent, just like they tried to upload it using a different filename. [02:53] should we nuke the original filecontent? [02:53] No. [02:53] kiko: filecontent is readonly except for garbage collection (in the future) [02:54] erm... writeonce [02:54] The filecontent is independent of names and mime-types (it's just a sequence of bytes). [02:54] I see. [02:54] And uploading the same content twice only writes it once -- the librarian catches dupes. [02:54] indeed. [02:54] sounds like the perfect archival mechanism -- the only thing it doesn't help us with is mirroring. [02:55] (properly -- it actually checks the bytes, not just the SHA digests ;) [02:55] the risk of a clash is that bad? [02:55] kiko: It will only take a minor extension to support mirroring, and the only code changes need to be done to the librarian [02:55] the mirrors need to run the librarian as well, however, I imagine? [02:56] kiko: Probably not, but it wasn't significantly harder to be sure. [02:56] so you run a real diff? [02:57] kiko: I listened to them too much in Oxford and believed that the minute chance of a clash worth worrying about. I have since done some more reading and match and believe that it really isn't worth doing a byte-by-byte :-) Future optimization - it is running fine atm. [02:58] heh. a sha-clash would be a confusing bug to follow though :) [02:58] kiko: No - any mirror. [02:59] stub, and how would the downloader get the right file? or would the mirrors be structured with symlinks? or is it yet something more obvious? [02:59] kiko: Yeah - but it would make us famous since we would be the first people to ever find one in the decade the hash has been around (and even more so since we would probably store the MD5 as well, and to clash we would have to dupe both) [02:59] stub: I believe the benefits of the optimisation wouldn't be worth worrying about either ;) [03:00] kiko: We add another table, called mirroredcontents or such. We have a process that checks mirrors, checks the librarian, and adds entries to this table. [03:01] stub, so far so good. when somebody comes to download? [03:01] kiko: To get a URL, launchpad et. al. ask the librian for a URL. So all the logic can be embedded there. [03:02] hummm [03:02] kiko: So the librarian might just give a URL to a load balancer/mirror selecter server. Or does a GEOIP and gives the URL direct to the mirror. Or whatever. We can even have rules like 'only mirror for files > X bytes' or 'check this cookie for further instructions' [03:03] so the end-user would get a URL to somewhere else. my question is if the somewhere else would have those files with their original filenames? [03:03] stub, which means we would probably have to duplicate files with same content and different IDs (or use symlinks) [03:06] kiko: The files would have to be served with the same filename and same mime-type. This also QA's our mirrors. [03:07] (we could relax that rule if we want, but I like it) [03:08] indeed. [03:08] The only files that might have multiple mime-types are the pissy little ones we don't need to worry about mirroring (text/plain, text/xml, application/xml) === stub drives wife to the local library === stub is back [03:32] great! [03:32] stub, so you'll be going alone to SA? [03:45] kiko: Yes. Kirsten is trying to stop herself getting distracted from the Great Work. [03:45] smart girl she is. [03:46] there's only so much field work that can be absorbed in a lifetime -- ask me one day. [03:46] o/' you spin me round round baby round round o/ [04:06] I think making product names unique will bite us :-( I'm just creating some products in dogfood and realizing that they are all pretty generic names, which would be just fine if (project, product) was the key. === bradb [~bradb@modemcable225.186-131-66.mc.videotron.ca] has joined #launchpad === stub [~stub@dsl-246.248.240.220.dsl.comindico.com.au] has joined #launchpad === vinsci [~vinsci@dsl-sjkgw2jb1.dial.inet.fi] has joined #launchpad === stub [~stub@dsl-246.248.240.220.dsl.comindico.com.au] has joined #launchpad === salgado [~salgado@200-206-134-238.async.com.br] has joined #launchpad === salgado [~salgado@200-206-134-238.async.com.br] has joined #launchpad === debonzi [~debonzi@200.158.100.251] has joined #launchpad === SteveA [~steve@213.226.190.26] has joined #launchpad === bradb [~bradb@p188.h-yulrz01.stsn.com] has joined #launchpad === lamont_r [~lamont@mesaradio41.customer.frii.net] has joined #launchpad === bradb [~bradb@p188.h-yulrz01.stsn.com] has joined #launchpad === debonzi [~debonzi@200.158.100.251] has left #launchpad [] === debonzi [~debonzi@200.158.100.251] has joined #launchpad === debonzi [~debonzi@200-206-134-238.async.com.br] has joined #launchpad === debonzi [~debonzi@200-206-134-238.async.com.br] has left #launchpad [] === debonzi [~debonzi@200-206-134-238.async.com.br] has joined #launchpad === SteveA [~steve@213.226.190.49] has joined #launchpad === debonzi [~debonzi@200.158.100.251] has joined #launchpad === salgado [~salgado@200-206-134-238.async.com.br] has joined #launchpad === lamont_r [~lamont@216-160-156-23.dnvr.qwest.net] has joined #launchpad === lamont_r [~lamont@dsl-175-246.dynamic-dsl.frii.net] has joined #launchpad === SteveA_ [~steve@adsl-213-190-44-43.takas.lt] has joined #launchpad