#metabrainz

/

      • alastairp
        for now I could do it manually - especially because the summary function only calls other functions which SELECT
      • 2015-10-15 28836, 2015

      • ruaok
        ideally to make it *really* clear, that connection should be passed to get_*_level()
      • 2015-10-15 28845, 2015

      • alastairp
        this is what I'm trying to avoid
      • 2015-10-15 28803, 2015

      • ruaok
        well, at this point, what does the called function do?
      • 2015-10-15 28810, 2015

      • alastairp
        one SELECT
      • 2015-10-15 28817, 2015

      • ruaok
        if it starts with another with ... statement that it will get another connection to the DB.
      • 2015-10-15 28828, 2015

      • alastairp
        however, the called function is also called directly from the web sometimes
      • 2015-10-15 28836, 2015

      • alastairp
        (lowlevel get, it's called on an api reqeust)
      • 2015-10-15 28847, 2015

      • ruaok
        k
      • 2015-10-15 28817, 2015

      • alastairp
        so, I could make all get_* functions take a connection object, and make a new connection in flask on each request
      • 2015-10-15 28836, 2015

      • Gentlecat
        you can make it optional
      • 2015-10-15 28844, 2015

      • ruaok
        that would be the most explicit and remove ambiguity.
      • 2015-10-15 28848, 2015

      • Gentlecat
        but that doesn't make it less ugly :(
      • 2015-10-15 28855, 2015

      • ruaok
        Gentlecat: yes, that is good.
      • 2015-10-15 28808, 2015

      • ruaok
        IMnsHO, if you have to ask for an expert on how things are done, the your code needs to become more explicit.
      • 2015-10-15 28843, 2015

      • ruaok
        then again, I apparently have no clue how to code, so listening to me is probably not a good idea.
      • 2015-10-15 28844, 2015

      • ruaok
        :)
      • 2015-10-15 28846, 2015

      • alastairp
      • 2015-10-15 28852, 2015

      • alastairp
        this is what I had started to do
      • 2015-10-15 28857, 2015

      • RJ2 has quit
      • 2015-10-15 28827, 2015

      • Gentlecat
        maybe passing connection around is not actually that bad
      • 2015-10-15 28828, 2015

      • alastairp
      • 2015-10-15 28846, 2015

      • 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
      • 2015-10-15 28835, 2015

      • alastairp
        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
      • 2015-10-15 28839, 2015

      • ruaok
        it is exactly this type of stuff that makes me dislike ORMs and SQLalchemy in particular.
      • 2015-10-15 28847, 2015

      • alastairp
        ruaok: we're not using ORMs
      • 2015-10-15 28809, 2015

      • ruaok
        s/ORM/overly clever db abstractions/g
      • 2015-10-15 28812, 2015

      • alastairp
        theis issue was also present when we were using psycopg2
      • 2015-10-15 28817, 2015

      • Gentlecat
        and it wasn't better before
      • 2015-10-15 28820, 2015

      • Gentlecat
        right
      • 2015-10-15 28827, 2015

      • alastairp
        we just put our heads in the sand and hoped it wouldn't be a problem
      • 2015-10-15 28830, 2015

      • alastairp
        I'm trying to fix that
      • 2015-10-15 28853, 2015

      • alastairp
        s/ORMs/webapps/
      • 2015-10-15 28806, 2015

      • 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.
      • 2015-10-15 28823, 2015

      • RJ2 joined the channel
      • 2015-10-15 28837, 2015

      • ruaok
        and yes, in this case transactions don't come into the game, unless you need 100% garanteed data consistency between these two calls.
      • 2015-10-15 28854, 2015

      • ruaok
        in which case you would use a transaction in order to use the isolation feature.
      • 2015-10-15 28851, 2015

      • alastairp
        right. I think this is what I'm getting to
      • 2015-10-15 28806, 2015

      • D4RK-PH0ENiX has quit
      • 2015-10-15 28848, 2015

      • alastairp
        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
      • 2015-10-15 28817, 2015

      • ruaok
        yes, but you will likely run into a problem in the future, so having a plan for it is good.
      • 2015-10-15 28844, 2015

      • Gentlecat
        alastairp: maybe another way to think about that is that each interface/function in the db package should be isolated
      • 2015-10-15 28813, 2015

      • alastairp
        that doesn't make sense for duplication of code, though
      • 2015-10-15 28843, 2015

      • alastairp
        we will end up having "get lowlevel data" written 4 times in the module so that we can keep code within a function
      • 2015-10-15 28855, 2015

      • alastairp
        (this is the problem that I've been trying to fix, it was already duplicated twice)
      • 2015-10-15 28840, 2015

      • Gentlecat
        why would we have it 4 times?
      • 2015-10-15 28852, 2015

      • alastairp
        well, we already had it twice
      • 2015-10-15 28810, 2015

      • alastairp
        get_low_level, and get_summary - which loaded lowlevel and highlevel
      • 2015-10-15 28827, 2015

      • alastairp
        I could see there being another case where we had to get lowlevel data to compare it to something else
      • 2015-10-15 28851, 2015

      • alastairp
        hmm
      • 2015-10-15 28802, 2015

      • alastairp
        I'm looking at what I did with messybrainz - I pass a connection to all database methods
      • 2015-10-15 28830, 2015

      • alastairp
        which helps make it explicit. I think I just did it at that time to make it work as quickly as possible
      • 2015-10-15 28811, 2015

      • alastairp
        in the docs they also have an example of it: http://docs.sqlalchemy.org/en/rel_1_0/core/connec…
      • 2015-10-15 28812, 2015

      • alastairp
        ah, ruaok was smart in the HL extractor, all the database work is done on the mainthread
      • 2015-10-15 28824, 2015

      • ruaok
        smart? don't confuse laziness for intelligence.
      • 2015-10-15 28842, 2015

      • alastairp
        perfect. I'll keep believing you're smart
      • 2015-10-15 28854, 2015

      • ruaok
        keep?
      • 2015-10-15 28805, 2015

      • alastairp
        <- optimist
      • 2015-10-15 28829, 2015

      • larsen has quit
      • 2015-10-15 28804, 2015

      • larsen joined the channel
      • 2015-10-15 28810, 2015

      • LordSputnik joined the channel
      • 2015-10-15 28826, 2015

      • samphippen joined the channel
      • 2015-10-15 28854, 2015

      • LordSputnik has quit
      • 2015-10-15 28857, 2015

      • legoktm
        good morning o/
      • 2015-10-15 28859, 2015

      • LordSputnik joined the channel
      • 2015-10-15 28855, 2015

      • legoktm
        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?
      • 2015-10-15 28810, 2015

      • legoktm
        (and whatever other rights are needed)
      • 2015-10-15 28828, 2015

      • ruaok
        sure.
      • 2015-10-15 28843, 2015

      • ruaok
        that VM is your domain, feel free to do things as you need to.
      • 2015-10-15 28814, 2015

      • alastairp
        OK. We have a mid-term solution that we'll go for
      • 2015-10-15 28833, 2015

      • alastairp
        but I'd still like to talk to someone who actually knows what they're doing
      • 2015-10-15 28836, 2015

      • ruaok bets luks does
      • 2015-10-15 28833, 2015

      • alastairp
        for now we're going to open explicit transactions in the methods we know require them (write lowleve, write highlevel, some dataset methods)
      • 2015-10-15 28800, 2015

      • D4RK-PH0ENiX joined the channel
      • 2015-10-15 28829, 2015

      • D4RK-PH0ENiX has quit
      • 2015-10-15 28835, 2015

      • diana_olhovik_ has quit
      • 2015-10-15 28858, 2015

      • D4RK-PH0ENiX joined the channel
      • 2015-10-15 28809, 2015

      • D4RK-PH0ENiX has quit
      • 2015-10-15 28817, 2015

      • D4RK-PH0ENiX joined the channel
      • 2015-10-15 28841, 2015

      • ruaok
        are you a fan of Kraftwerk? Love "Autobahn"? If so, this is a must for you:
      • 2015-10-15 28842, 2015

      • ruaok
      • 2015-10-15 28842, 2015

      • ariscop has quit
      • 2015-10-15 28806, 2015

      • ruaok
        especially the first 30 seconds. :)
      • 2015-10-15 28855, 2015

      • ruaok cries
      • 2015-10-15 28859, 2015

      • ruaok
        no one? really?
      • 2015-10-15 28822, 2015

      • Mogmi
        sorry
      • 2015-10-15 28823, 2015

      • ariscop joined the channel
      • 2015-10-15 28853, 2015

      • Gentlecat
      • 2015-10-15 28802, 2015

      • Gentlecat
        maybe you can delegate that too
      • 2015-10-15 28845, 2015

      • ruaok
        I'll try and do that tomorrow.
      • 2015-10-15 28858, 2015

      • ruaok
        I fear that if I pack more on zas he'll quit. :)
      • 2015-10-15 28812, 2015

      • LordSputnik
        ruaok: some... interesting.. .covers there :P
      • 2015-10-15 28830, 2015

      • ruaok
        yeah, I love that album.
      • 2015-10-15 28841, 2015

      • ruaok
        but the first 30 seconds of the autobahn track are great.
      • 2015-10-15 28800, 2015

      • ruaok
        in the original autobahn the sound is of a car starting. perfectly and on the first time.
      • 2015-10-15 28808, 2015

      • ruaok
        the south american version....
      • 2015-10-15 28849, 2015

      • luks
        ruaok: alastairp: I think I do, but I have weird preferences about database connection management :)
      • 2015-10-15 28809, 2015

      • alastairp
        luks: I would love to hear about them
      • 2015-10-15 28814, 2015

      • ruaok listens as well
      • 2015-10-15 28801, 2015

      • LordSputnik
        ruaok: I thought it was something like that, I've only really listened to the Man Machine album
      • 2015-10-15 28802, 2015

      • alastairp
        I can give a bit more context on our side as well
      • 2015-10-15 28858, 2015

      • luks
        kind of busy atm, but we can chat later
      • 2015-10-15 28804, 2015

      • alastairp
        sure thing
      • 2015-10-15 28807, 2015

      • alastairp
        me too
      • 2015-10-15 28853, 2015

      • ruaok
        https://www.stickermule.com/ is that borken for anyone else too?
      • 2015-10-15 28858, 2015

      • ruaok
        I get an invalid cert issue.
      • 2015-10-15 28805, 2015

      • darwin
        07:23 < ruaok> it is exactly this type of stuff that makes me dislike ORMs and SQLalchemy in particular.
      • 2015-10-15 28818, 2015

      • darwin
        if you are a small team, the overhead of ORM is sometimes worse than what it cures
      • 2015-10-15 28828, 2015

      • darwin
        if you are a larger team, you really don't want devs wrting SQL
      • 2015-10-15 28836, 2015

      • ruaok
        darwin: makes sense to me.
      • 2015-10-15 28846, 2015

      • ruaok
        Leftmost: ping
      • 2015-10-15 28824, 2015

      • ruaok
        LordSputnik: ping
      • 2015-10-15 28857, 2015

      • LordSputnik
        ruaok: pong
      • 2015-10-15 28818, 2015

      • ruaok
        I'm trying to order stickers for all of the projects.
      • 2015-10-15 28823, 2015

      • ruaok
        what do I do about the BB stickers?
      • 2015-10-15 28828, 2015

      • LordSputnik
        Keep brown
      • 2015-10-15 28836, 2015

      • ruaok
        ok
      • 2015-10-15 28807, 2015

      • ruaok
        3"x3" stickers. Die cut (in the hexagon shape). Of MB, AB, LB, picard, CB, MeB and BB. yes, no?
      • 2015-10-15 28801, 2015

      • LordSputnik
        Do they do custom T-shirts as well as stickers?
      • 2015-10-15 28832, 2015

      • ruaok
        don't think so.
      • 2015-10-15 28836, 2015

      • ruaok
        bitmap: are you around?
      • 2015-10-15 28822, 2015

      • ruaok has quit
      • 2015-10-15 28840, 2015

      • yeeeargh joined the channel
      • 2015-10-15 28822, 2015

      • JesseW joined the channel
      • 2015-10-15 28805, 2015

      • ruaok joined the channel
      • 2015-10-15 28847, 2015

      • JesseW has quit
      • 2015-10-15 28847, 2015

      • alastairp
        ruaok: we can move lowlevel to metadata/json tables too!
      • 2015-10-15 28813, 2015

      • ruaok
        clean up lots of sins. :)
      • 2015-10-15 28829, 2015

      • alastairp
        darwin: I'm a co-maintainer on an ORM-based app written by people who don't understand relational databases
      • 2015-10-15 28833, 2015

      • alastairp
        it shows
      • 2015-10-15 28858, 2015

      • alastairp
        I'm really glad that I started development with sql, then started with ORMs
      • 2015-10-15 28807, 2015

      • alastairp
        I'm finally starting to learn the middleground
      • 2015-10-15 28815, 2015

      • darwin
        alastairp: haha, that sounds... fun.
      • 2015-10-15 28853, 2015

      • alastairp
        darwin: newrelic free trial + some indexes -> postgres cpu usage from 90% to 15%
      • 2015-10-15 28814, 2015

      • reosarevok joined the channel
      • 2015-10-15 28814, 2015

      • reosarevok has quit
      • 2015-10-15 28814, 2015

      • reosarevok joined the channel
      • 2015-10-15 28849, 2015

      • drsaunders
        fyi i think there may be a server issue atm
      • 2015-10-15 28815, 2015

      • ruaok
        thanks will look.
      • 2015-10-15 28823, 2015

      • ruaok
        zas: you around?
      • 2015-10-15 28832, 2015

      • ruaok
        here is your first chance to save the day! :)
      • 2015-10-15 28853, 2015

      • ruaok
        uh oh.
      • 2015-10-15 28803, 2015

      • ruaok
        corosync on ernie ia 100% cpu load.
      • 2015-10-15 28847, 2015

      • bitmap
        ruaok: I'm here now
      • 2015-10-15 28834, 2015

      • ruaok
        yeah, I was wondering about sending stickers to you and have you bring them, but you leave too soon.
      • 2015-10-15 28838, 2015

      • ruaok
        I'll have to pester Leftmost
      • 2015-10-15 28853, 2015

      • bitmap
        ah, right
      • 2015-10-15 28834, 2015

      • bitmap
        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
      • 2015-10-15 28859, 2015

      • bitmap
        I don't see a way to make someone admin of a repo, if that exists
      • 2015-10-15 28843, 2015

      • demonimin has quit