IRC log for #storm on 20080613

00:00.31*** join/#storm wallflower (n=wallflow@ip-205-246-113-216.pool.grokthis.net)
01:27.23*** join/#storm thumper (n=tim@canonical/launchpad/thumper)
01:32.11*** join/#storm thumper_laptop (n=tim@125-236-193-95.adsl.xtra.co.nz)
03:24.10*** join/#storm rockstar_ (n=rockstar@75-171-134-187.hlrn.qwest.net)
04:52.43*** join/#storm dobee (n=dobee@85-124-200-100.static.xdsl-line.inode.at)
05:33.10*** join/#storm dobee (n=dobee@lsfw01.lovelysystems.com)
05:40.21*** join/#storm bac` (n=bac@cpe-065-190-187-178.nc.res.rr.com)
06:00.29*** join/#storm jukart (n=jukart@lsfw01.lovelysystems.com)
06:04.02*** join/#storm bac (n=bac@cpe-065-190-187-178.nc.res.rr.com)
08:37.51*** join/#storm mcella (n=mcella@ip-176-247.sn2.eutelia.it)
08:44.33*** join/#storm jkakar (n=jkakar@nat/canonical/x-9a8889ffcbf16be9)
08:46.06*** join/#storm niemeyer (n=niemeyer@nat/canonical/x-1919aa3dfc385dee)
08:46.33niemeyerMorning!
08:48.30jameshhi niemeyer
08:48.42niemeyerjamesh: Yo!
08:49.05jameshdo you have any ultra fast C extensions for me? :)
08:49.13niemeyerjamesh: I didn't manage to finish the cextensions work yet, but I've made some good progress
08:49.19jameshcool
08:49.54niemeyerjamesh: I fixed what was broken, and am halfway through the Compile implementation
08:50.11jameshniemeyer: at least in the short term, I am replacing the Cache() implementation for LP with one that doesn't evict
08:50.30jameshessentially the same effect as the normal cache with a sys.maxint size
08:50.39jameshbut without overhead of maintaining the LRU list
08:52.27niemeyerjamesh: Hmm, interesting
08:53.03jameshniemeyer: eventually it'd be nice to have an interface to ZStorm (perhaps in ZCML) to set this policy
08:53.05niemeyerjamesh: Do you think the overhead is the issue, or the fact that it doesn't keep items forever?
08:53.09jameshbut for now I'm just monkey patching it in
08:53.52niemeyerjamesh: Definitely.. it should be fully configurable eventually.. we just didn't want to make any promises about API and whatnot on that first god
08:53.56jameshniemeyer: unfortunately, we've got code that expects objects not to expire within the transaction
08:53.57niemeyers/god/go
08:54.12niemeyerjamesh: Oh, wow
08:54.32niemeyerjamesh: Do you think the non-expiry could be an issue somewhere else?
08:54.38jameshI mean "not be garbage collected"
08:54.56niemeyerjamesh: Like, iterating a very large number of objects, or is that never done in Launchpad?
08:56.17jameshniemeyer: it definitely isn't optimal, but we had a few important pages time out when putting this code live on edge
08:56.33jameshniemeyer: so at the moment I'm trying to cut overhead where possible
08:57.10niemeyerjamesh: I see.. was just reading the message from Francis
08:57.13jameshand the old code worked with "cache forever within the transaction", so it isn't introducing any problems we didn't already have ...
08:59.52niemeyerjamesh: Gotcha
09:03.24jameshniemeyer: when you think you have something worth testing (even if it isn't completely finished), I can give it a spin locally
09:04.19thumperniemeyer: can I get you to review therve's branch with group_by?
09:04.25thumperniemeyer: I actually want to use that :)
09:04.36niemeyertherve: Hey!
09:04.41niemeyerthumper: I mean, hey! :)
09:04.51niemeyerthumper: Definitely!
09:04.54thumperniemeyer: howdy
09:04.59niemeyerthumper: I'll have a look at that today then
09:05.06thumperniemeyer: I'm looking forward to getting you guys using the new code review features
09:05.25thumperniemeyer: though best to wait for the 1.2.6 release of LP so you can reply to the sent email
09:05.41niemeyerthumper: Oh, nice!
09:12.32*** join/#storm mcella (n=mcella@ip-176-247.sn2.eutelia.it)
09:18.30*** join/#storm ubot3 (n=ubot3@unaffiliated/nalioth/bot/ubot3)
14:54.34*** join/#storm nullie (n=ilya@87.254.134.62)
14:54.40nulliehello
14:58.26nullieI used to attach files to sqlalchemy entities by adding hooks for insert and delete, so I could create file attached to id after entity got to database and remove file before entity gets deleted from database
14:58.40nullieCan I do that with storm? I can't find appropriate hooks
15:00.27radixnullie: what's the SQL feature you want to use?
15:00.31jkakarnullie: Do you mean you write a file to the disk on INSERT (of some object) and remove it on DELETE?
15:00.43nulliejkakar, yes, after INSERT and before DELETE
15:01.10nullieradix, that's not sql feature, that's mapper feature. I need after_insert and before_delete hooks
15:01.44radixnullie: isn't it better to do that after committing the transaction?
15:01.49radixsince that's what represents the actual change in the database?
15:01.57radixand otherwise you could have inconsistency
15:02.09jkakarnullie: Are you worried about changes made to the database behind Storm's back?
15:03.02jkakarnullie: Could you not do this in whatever method you use to insert or delete given objects?  Or are you use store.find().remove() for the same thing in multiple places?
15:03.16nullieradix, humm, yes
15:03.55nulliejkakar, no, I'm not worried
15:05.33nulliejkakar, well, if I delete parent object and storm deletes it's relations, I'd like to have attached files deleted as well
15:06.15jkakarnullie: Hmm.  Storm doesn't do cascading deletes, so this would all happen in the database... Storm wouldn't know to broadcast events for chlid relations being deleted.
15:06.19radixnullie: if by that last thing you mean ON DELETE CASCADE, storm isn't the thing that does the deleting
15:06.22nulliehumm
15:06.29radixit's the database
15:06.45nulliewell
15:07.43nullieLooks like I still haven't found right solution for that problem
15:07.59jkakarCan you explain more about the problem?
15:08.13niemeyernullie: Another option is adding __storm_flushed__() to your object, and inside it checking if Store.of(self) is None, which would indicate that the object has been removed
15:08.16nullieI want to have pictures attached to some of entities
15:08.32nullieand don't want to store them in database
15:08.50niemeyernullie: It's still not 100% safe, though, as if the transaction fails after this specific object is flushed, the database state won't reflect your filesystem attachments
15:09.46niemeyernullie: On the other hand, nothing besides "post mortem" consistency checking will help you entirely in this case
15:09.56radixnullie: hmm, ok, you should probably just write the files into a filestore immediately and refer to their filenames in the database, no?
15:10.00niemeyernullie: Two-phase committing is hard
15:10.16nullieprobably I will resort to post mortem checking
15:10.24radixthen of course if something bad happens or the object needs to be deleted, you will need to "garbage collect" the filestore
15:10.32nulliestill I need it for my current models
15:10.43nullieyes, garbage collection
15:10.52nulliesounds nice
15:10.59niemeyerRight
15:14.55nullieAlso I wanted to ask: will [offset:limit] slicing would do the right thing on resultset?
15:15.07nullieuh, I mean [offset:offset+limit]
15:15.56jkakarYou could use a trigger... copy the file to a standard location (/tmp/incoming-photos), attach the filename to a column on your entity, and then have a trigger copy it into the right place, or delete it.
15:16.14jkakarplpython!
15:17.24radixdon't use triggers kids, stay in school
15:17.26jkakarThat's also going to cause inconsistency problems though.
15:17.40radixnullie: yes, it does the right thing (i.e., uses OFFSET and LIMIT)
15:17.51nulliejkakar, that would introduce complex iterations betweeb DBMS and app
15:17.55nullieinteractions
15:18.03jkakarnullie: Yeah.  Trigger are terrible. :)
15:18.06jkakarTriggerS
15:18.14nullieI try to follow KISS principle
15:19.54nulliethank you very much
15:39.49radixyou're welcome nullie
16:57.59*** join/#storm goschtl (n=goschtl@80.187.146.122)
17:02.28goschtlhi, i ve seen that there is a group_by branch. any plans to add this to a new release?
17:04.19thervegoschtl: it will in trunk 'real soon now' (tm)
17:04.40thervethen the next release should be done, which could take some time
17:04.43goschtltherve: cool how can i download the branch?
17:05.08thervewell it should be specified in launchpad?
17:05.47thervesomething like bzr branch lp:~therve/storm/resultset-groupby-2 I think
17:15.05goschtltherve: i have found it thanks
18:21.51*** join/#storm bigdog (n=scmikes@72-197-8-8-arpa.cust.cinci.current.net)
18:36.33*** join/#storm ubot3 (n=ubot3@unaffiliated/nalioth/bot/ubot3)
18:46.42nulliein current release, is it possible to express SELECT t2.count(*), t1.id FROM t1, t2 WHERE t2.parent_id == t1.id GROUP BY t1.id
19:29.34jkakarnullie: Nope.  therve has a branch at lp:~therve/storm/resultset-groupby-2 in review that introduces the ability to do this.  It's in review and wlil be in the next release.
19:30.01jkakarWe're planning on doing the release relatively soon, but it likely be a few weeks yet.
19:30.52therveyou can do it using a Select class, but not using store.find(...)
19:31.55nullieok

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.