#metabrainz

/

      • alastairp
        for now I could do it manually - especially because the summary function only calls other functions which SELECT
      • ruaok
        ideally to make it *really* clear, that connection should be passed to get_*_level()
      • alastairp
        this is what I'm trying to avoid
      • ruaok
        well, at this point, what does the called function do?
      • alastairp
        one SELECT
      • ruaok
        if it starts with another with ... statement that it will get another connection to the DB.
      • alastairp
        however, the called function is also called directly from the web sometimes
      • (lowlevel get, it's called on an api reqeust)
      • ruaok
        k
      • alastairp
        so, I could make all get_* functions take a connection object, and make a new connection in flask on each request
      • Gentlecat
        you can make it optional
      • ruaok
        that would be the most explicit and remove ambiguity.
      • Gentlecat
        but that doesn't make it less ugly :(
      • ruaok
        Gentlecat: yes, that is good.
      • IMnsHO, if you have to ask for an expert on how things are done, the your code needs to become more explicit.
      • then again, I apparently have no clue how to code, so listening to me is probably not a good idea.
      • :)
      • alastairp
      • this is what I had started to do
      • RJ2 has quit
      • Gentlecat
        maybe passing connection around is not actually that bad
      • alastairp
      • but the note here "The “threadlocal” feature is generally discouraged. It’s designed for a particular pattern of usage which is generally considered as a legacy pattern." makes me think twice
      • the other thing is that there is only one case where this is a problem currently, and they're both SELECTs, so there's no issues with transactions
      • ruaok
        it is exactly this type of stuff that makes me dislike ORMs and SQLalchemy in particular.
      • alastairp
        ruaok: we're not using ORMs
      • ruaok
        s/ORM/overly clever db abstractions/g
      • alastairp
        theis issue was also present when we were using psycopg2
      • Gentlecat
        and it wasn't better before
      • right
      • alastairp
        we just put our heads in the sand and hoped it wouldn't be a problem
      • I'm trying to fix that
      • s/ORMs/webapps/
      • ruaok
        this feels like shoveling it to the a different part of the sandbox and sticking your head into a different part of the sandbox.
      • RJ2 joined the channel
      • and yes, in this case transactions don't come into the game, unless you need 100% garanteed data consistency between these two calls.
      • in which case you would use a transaction in order to use the isolation feature.
      • alastairp
        right. I think this is what I'm getting to
      • D4RK-PH0ENiX has quit
      • where we don't need a transaction for this specific case, so we shouldn't try and make a generic solution for a problem we don't have
      • ruaok
        yes, but you will likely run into a problem in the future, so having a plan for it is good.
      • Gentlecat
        alastairp: maybe another way to think about that is that each interface/function in the db package should be isolated
      • alastairp
        that doesn't make sense for duplication of code, though
      • we will end up having "get lowlevel data" written 4 times in the module so that we can keep code within a function
      • (this is the problem that I've been trying to fix, it was already duplicated twice)
      • Gentlecat
        why would we have it 4 times?
      • alastairp
        well, we already had it twice
      • get_low_level, and get_summary - which loaded lowlevel and highlevel
      • I could see there being another case where we had to get lowlevel data to compare it to something else
      • hmm
      • I'm looking at what I did with messybrainz - I pass a connection to all database methods
      • which helps make it explicit. I think I just did it at that time to make it work as quickly as possible
      • in the docs they also have an example of it: http://docs.sqlalchemy.org/en/rel_1_0/core/conn...
      • ah, ruaok was smart in the HL extractor, all the database work is done on the mainthread
      • ruaok
        smart? don't confuse laziness for intelligence.
      • alastairp
        perfect. I'll keep believing you're smart
      • ruaok
        keep?
      • alastairp
        <- optimist
      • larsen has quit
      • larsen joined the channel
      • LordSputnik joined the channel
      • samphippen joined the channel
      • LordSputnik has quit
      • legoktm
        good morning o/
      • LordSputnik joined the channel
      • ruaok: I did most of the easy mysql schema changes last night, when I tried to do the larger ones with pt-online-schema-change, it complained the mediawiki mysql user didn't have the PROCESS right. Is it alright if I create a new mysql user specifically for pt-osc with that right?
      • (and whatever other rights are needed)
      • ruaok
        sure.
      • that VM is your domain, feel free to do things as you need to.
      • alastairp
        OK. We have a mid-term solution that we'll go for
      • but I'd still like to talk to someone who actually knows what they're doing
      • ruaok bets luks does
      • for now we're going to open explicit transactions in the methods we know require them (write lowleve, write highlevel, some dataset methods)
      • D4RK-PH0ENiX joined the channel
      • D4RK-PH0ENiX has quit
      • diana_olhovik_ has quit
      • D4RK-PH0ENiX joined the channel
      • D4RK-PH0ENiX has quit
      • D4RK-PH0ENiX joined the channel
      • ruaok
        are you a fan of Kraftwerk? Love "Autobahn"? If so, this is a must for you:
      • ariscop has quit
      • especially the first 30 seconds. :)
      • ruaok cries
      • no one? really?
      • Mogmi
        sorry
      • ariscop joined the channel
      • Gentlecat
      • maybe you can delegate that too
      • ruaok
        I'll try and do that tomorrow.
      • I fear that if I pack more on zas he'll quit. :)
      • LordSputnik
        ruaok: some... interesting.. .covers there :P
      • ruaok
        yeah, I love that album.
      • but the first 30 seconds of the autobahn track are great.
      • in the original autobahn the sound is of a car starting. perfectly and on the first time.
      • the south american version....
      • luks
        ruaok: alastairp: I think I do, but I have weird preferences about database connection management :)
      • alastairp
        luks: I would love to hear about them
      • ruaok listens as well
      • LordSputnik
        ruaok: I thought it was something like that, I've only really listened to the Man Machine album
      • alastairp
        I can give a bit more context on our side as well
      • luks
        kind of busy atm, but we can chat later
      • alastairp
        sure thing
      • me too
      • ruaok
        https://www.stickermule.com/ is that borken for anyone else too?
      • I get an invalid cert issue.
      • darwin
        07:23 < ruaok> it is exactly this type of stuff that makes me dislike ORMs and SQLalchemy in particular.
      • if you are a small team, the overhead of ORM is sometimes worse than what it cures
      • if you are a larger team, you really don't want devs wrting SQL
      • ruaok
        darwin: makes sense to me.
      • Leftmost: ping
      • LordSputnik: ping
      • LordSputnik
        ruaok: pong
      • ruaok
        I'm trying to order stickers for all of the projects.
      • what do I do about the BB stickers?
      • LordSputnik
        Keep brown
      • ruaok
        ok
      • 3"x3" stickers. Die cut (in the hexagon shape). Of MB, AB, LB, picard, CB, MeB and BB. yes, no?
      • LordSputnik
        Do they do custom T-shirts as well as stickers?
      • ruaok
        don't think so.
      • bitmap: are you around?
      • ruaok has quit
      • yeeeargh joined the channel
      • JesseW joined the channel
      • ruaok joined the channel
      • JesseW has quit
      • alastairp
        ruaok: we can move lowlevel to metadata/json tables too!
      • ruaok
        clean up lots of sins. :)
      • alastairp
        darwin: I'm a co-maintainer on an ORM-based app written by people who don't understand relational databases
      • it shows
      • I'm really glad that I started development with sql, then started with ORMs
      • I'm finally starting to learn the middleground
      • darwin
        alastairp: haha, that sounds... fun.
      • alastairp
        darwin: newrelic free trial + some indexes -> postgres cpu usage from 90% to 15%
      • reosarevok joined the channel
      • reosarevok has quit
      • reosarevok joined the channel
      • drsaunders
        fyi i think there may be a server issue atm
      • ruaok
        thanks will look.
      • zas: you around?
      • here is your first chance to save the day! :)
      • uh oh.
      • corosync on ernie ia 100% cpu load.
      • bitmap
        ruaok: I'm here now
      • ruaok
        yeah, I was wondering about sending stickers to you and have you bring them, but you leave too soon.
      • I'll have to pester Leftmost
      • bitmap
        ah, right
      • zas: it looks like you're already an owner for the metbrainz org, and the 'musicbrainz' account password is in syswiki, not sure there's anything else I can do
      • I don't see a way to make someone admin of a repo, if that exists
      • demonimin has quit