/srv/irclogs.ubuntu.com/2012/12/12/#launchpad-dev.txt

StevenKmwhudson: Haha00:00
wgrantStevenK: Ah, yes, you'll need the cast00:06
StevenKwgrant: Yeah, it's working00:08
StevenKTurns out my guess was right00:08
wgrantmwhudson: This isn't particularly great00:08
wgrantevil00:08
wgrantI've done much worse :)00:08
mwhudsoni'm sure00:08
mwhudsonwgrant: did i show you http://voices.canonical.com/michael.hudson/2012/09/02/using-postgres-array_agg-from-django/ ?00:08
wgrantI might need popcorn00:09
wgrantHah00:10
wgrantSo not too hacky00:10
mwhudsonthe bit with decimalfield was pretty awful00:10
mwhudsonbut otherwise, no00:10
wgrantYeah00:10
StevenKaggregate.field = DecimalField() # vomit00:11
StevenKHaha00:11
mwhudsonhow did lp upgrade from postgres 8 to 9?02:01
mwhudsoncan you slony between 8 and 9?02:01
StevenKWe dropped slony too02:01
mwhudsonyes02:02
mwhudsonbut that was afterwards :-)02:02
StevenKDuring, in fact02:02
wgrantmwhudson: That's like saying Ubuntu 10 and Ubuntu 11 :)02:02
mwhudsonhm02:02
mwhudsonwgrant: heh well02:02
wgrantWe upgraded 8.4 to 9.1 with Slony02:02
wgrantThen dropped slony for our internal replication02:02
wgrantWe will use slony again for the 9.1 -> 9.2 upgrade02:02
wgrantThen drop it immediately afterwards02:03
mwhudsonso you had a pg 8.4 master talking to a 9.1 slave, then rotated the 9.1 slave to be the master?02:03
wgrantRight02:03
mwhudsonok02:03
* mwhudson finally read http://www.postgresql.org/docs/9.1/static/pgupgrade.html properly and didn't like it much02:03
wgrantIf your system can go down for a while, it's better to just pg_upgrade during a bit of downtime02:03
mwhudsonheh02:03
StevenKI recall the master pivot being a little messy, but we worked out the issues with it and the second pivot back was cleaner02:03
wgrantIIRC we pg_upgraded the slaves02:03
wgrantStevenK: That was with native replication around the move -- unrelated.02:04
wgrantmwhudson: So, if you can tolerate downtime and your DB is small then just pg_upgrade02:04
wgrantAnd be done :)02:04
mwhudsoni guess i should figure out how pg_upgrade works properly02:04
mwhudsonwgrant: yeah02:04
wgrantThere are occasionally caveats, but it's usually the best way02:05
wgrantIf the 9.2 pg_upgrade is fast enough we might even just go RO for a couple of minutes and avoid slony entirely02:06
mwhudsoni'm a little confused about clusters i guess02:06
StevenKwgrant: With pivoting or without?02:07
mwhudsonwill pg_upgrade try to destroy my existing 9.1/main cluster?02:07
wgrantmwhudson: It has two modes: copy and hardlink02:08
wgrantThe latter will destroy the original cluster02:08
wgrantCopy will create a copy, which is probably OK unless your DB is LP-sized02:08
mwhudsonwgrant: sure, i get that bit02:09
mwhudsonwgrant: where will it put the copy though?02:09
mwhudsonor do i get to decide that?02:09
mwhudsonthe db is small enough that i download copies of it for development ...02:09
wgrantIIRC you specify the source and target paths02:09
wgrantIt doesn't manage the clusters itself02:10
wgrantYeah02:10
mwhudsonah yeah02:10
wgrantYou create the new cluster and then use pg_upgrade to replace its data02:10
StevenKmwhudson: I have dreams about database's that small02:10
mwhudsonargh02:12
mwhudsonpg_upgrade is packaged as part of postgres-xc apparently02:12
mwhudsonbut postgres-xc appears to install its own version of everything02:13
mwhudsonmwhudson@narsil:non-default-database$ sudo -u postgres initdb -D /var/lib/postgresql/9.1/upgrade02:13
mwhudsoninitdb: Postgres-XC node name is mandatory02:13
StevenKpg_upgradecluster ?02:13
StevenKmwhudson: /usr/lib/postgresql/9.1/bin/pg_upgrade02:13
wgrantpg_upgradecluster is a Debian wrapper in PATH02:13
wgrant/usr/lib/postgresql/9.1/bin/pg_upgrade is the real binary02:13
mwhudsonahh02:14
mwhudsonoh ffs02:16
mwhudsonnow postgres-xc's maintainer scripts are failing and not letting me do anything02:17
wgrantHee hee02:17
lifelessmwhudson: you're running clustered ?02:17
StevenKmwhudson: sudo vi  and 'exit 0' ?02:17
* mwhudson should probably not have been allowed sudo today02:17
mwhudsonStevenK: that's what i'm thinking02:17
StevenKHahaha02:17
mwhudsonwell this was a little adventure i wasn't in the mood for02:21
lifelessmwhudson: how well does postgres-xc work?02:23
mwhudsonlifeless: installing it appears to mess everything up completely02:23
mwhudsonand haha of course postgres-8.4 isn't installable in quantal ;-)02:24
lifelessmwhudson: lxc ftw02:24
mwhudsonyeah02:24
mwhudsonThere were problems executing "/usr/lib/postgresql/8.4/bin/pg_ctl" -w -l "/dev/null" -D "/var/lib/postgresql/8.4/main"  stop >> "/dev/null" 2>&102:36
mwhudsonFailure, exiting02:36
mwhudson:(02:36
wgrant:(02:37
mwhudsonparticularly nice to pipe any error messages away02:38
mwhudsonoh02:42
lifelessspethial02:42
mwhudsonturns out -l fixes the errors go away problem02:42
mwhudsonnow i think it's that ubuntu puts the config not in the cluster but rather in /etc02:43
StevenKwgrant: https://code.launchpad.net/~stevenk/launchpad/populate-searchables-for-pu/+merge/138906 is ready for another look04:46
StevenKwgrant: And https://code.launchpad.net/~stevenk/launchpad/squash-archivesubscriptionerror/+merge/13938204:57
wgrantStevenK: What does set_archive_and_user do that can't be achieved by setting archive and user?05:01
StevenKwgrant: I can't set self.user directly05:01
wgrantYou don't set self.user at all, because that's the request user05:02
wgrantBut can't you set self.current_user directly?05:02
wgrantThe helper seems pointless05:02
wgrantAlso, I'd perhaps say context_user05:02
StevenKwgrant: If I try and set self.user = ... in the view, I get horrible errors05:02
wgrantSure05:03
wgrantself.user is special05:03
wgrantYou shouldn't be setting it05:03
wgrantAlso, self.archive is a bit odd, as it's reasonable for some other view to use that name05:03
wgrantPerhaps sources_list_archive and sources_list_user?05:03
wgrantAlso, on line 101 of that diff you use the request user's displayname, but the context user's name05:04
StevenKOh, hah, I missed one05:04
StevenKwgrant: http://pastebin.ubuntu.com/1426820/05:07
wgrantcontext_archive and context_user are still sort of overly generic for a very specific widget05:08
StevenKYou suck, and I hate you.05:09
wgrantOh, it already used self.archive?05:09
wgrantcurrent_user needs to change, but if it's already using self.archive then it's probably safest not to change that05:09
wgrantBecause current_user is precisely not the current user :)05:10
StevenKwgrant: http://pastebin.ubuntu.com/1426826/05:12
wgrantMuch clearer :)05:13
StevenKAnd less buggy, too boot05:14
wgrantStevenK: I still don't see any value in set_archive_and_user over setting the archive and user05:23
wgrantAnd the Nones might as well be defined in the class definition, rather than __init__05:23
StevenKOh, I can do that in the views if you wish05:23
StevenKwgrant: http://pastebin.ubuntu.com/1426839/05:25
StevenKSorry, I didn't realise you were still pushing back05:25
wgrantGreat05:26
lifelesswhat is he, a plane?05:30
StevenKwgrant: Diff updated05:31
StevenKwgrant: I wonder if we can forbid import cgi in the fascist06:11
wgrantcgi.parse_qs and friends are still useful06:12
wgrantAnd there's only one callsite of cgi.escape left in the entire tree06:12
wgrantSo there's no bad examples left for anybody to copy06:12
StevenK\o/06:12
wgrantSo I doubt any more will sneak in06:12
=== wgrant changed the topic of #launchpad-dev to: http://dev.launchpad.net/ | On-call reviewer: - | Firefighting: - | Critical bugs: ~150
StevenKwgrant: You fail at buildbot bingo again.06:58
StevenKwgrant: I thought sets were sorted?07:00
StevenKwgrant: And there is no normal add mechanism for PCJ'd PU's.07:01
wgrantStevenK: sets aren't sorted07:01
wgrantStevenK: That function isn't just used for PCJs07:01
wgrantIt's used to create all PUs07:02
StevenK>>> set(['b']) | set (['a'])07:02
StevenKset(['a', 'b'])07:02
StevenK>>> set(['c', 'd', 'b']) | set (['a'])07:04
StevenKset(['a', 'c', 'b', 'd'])07:04
StevenKEven07:04
StevenKwgrant: Right, but there isn't a addPCJ method on PU07:05
StevenKEither we have one, or we don't.07:05
StevenKI can call setSearchable* in the constructor if package_copy_job07:06
wgrantStevenK: Oh, I meant that you should call addSearchable*, yes07:06
wgrantNot addPCJ07:06
StevenKwgrant: In PU's constructor?07:07
wgrant>>> list(set(['foo', 'bar', 'baz']))07:07
wgrant['baz', 'foo', 'bar']07:07
wgrantYes07:07
StevenKHmmm07:07
StevenKI will add sorted()07:07
wgrantsets are by definition unordered07:07
lifelessthey have a sort order. Its the internal datastructure iteration order07:07
lifelesswhich is effectively random07:07
StevenKwgrant: appendSearchable*? Since that's what it does.07:08
wgrantSure07:08
lifelessin that you can't depend on it, in any regard07:08
wgrantBut it's undefined07:08
wgrantSo they're unordered :)07:08
wgrantStevenK: It doesn't strictly append, but the order doesn't matter. So I'd say add07:08
wgrantcjwatson: Do you want to retract https://code.launchpad.net/~cjwatson/launchpad/queue-filter-source/+merge/119225 now that we have a less disastrously unperformant solution?07:09
StevenKwgrant: PackageUpload has no __init__07:09
StevenKAnd I don't want to step on SQLBase's toes07:10
wgrantThere's no __init__, no07:10
wgrantBut there is a factory method somewhere07:10
wgrantThat you edited in that branch already07:11
StevenKThat doesn't help code that creates PCJs07:11
wgrantI am confused07:11
wgrantWhat doesn't work for what and why?07:12
StevenKwgrant: A PCJ may not require a PU. If it does, it calls createQueueEntry(). The factory methods for creating a PCJ don't touch that bit of the code, they have the job system do it07:12
StevenKAnd I'm not sure how I can call addSearchables* if there is no __init__, and no add{Source,Build,Custom} variant.07:13
wgrantWhy not?07:15
wgrantThe method on DistroSeries creates the PackageUpload and returns it07:15
wgrantIt can, between creating and returning it, call addSearchable*07:15
StevenKOooh07:15
wgrantOr the __init__ could, if you want to define an __init__07:15
wgrant(it's not uncommon to define an __init__ that just passes through the args and kwargs to super, then performs some operations afterwards)07:15
StevenKwgrant: http://pastebin.ubuntu.com/1426974/07:18
wgrantStevenK: And now you can add a comment to __init__ about how they get added for other cases :)07:19
wgrantAlso, consider how this is going to work when the two columns are NOT NULL07:19
StevenKThey can not be.07:19
wgrantYou'll need to have a sensible default, and you might as well arrange that now07:19
wgrantWhy not?07:19
wgrantThey have logical defaults: '' and []07:19
StevenKAh07:20
StevenKwgrant: http://pastebin.ubuntu.com/1426981/07:22
wgrantThat's wgrant Compliantâ„¢07:27
mwhudsonwgrant: in other wtf news, pg_upgradecluster appears to use pg_dump/pg_restore under the hood, not pg_upgrade08:01
* mwhudson fumes08:02
mwhudsonah08:04
mwhudsonhttp://bugs.debian.org/cgi-bin/bugreport.cgi?bug=68293808:04
=== tasdomas is now known as domas
=== domas is now known as domasm
=== domasm is now known as tasdomas
=== buildslayer is now known as shadeslayer
cjwatsonwgrant: Sure, retracted now11:20
cjwatsonand reassigned the bug to StevenK11:21
StevenKJust need to wait for my DB patch. And fix my test failures. And then wait for the garbo job to populate on all four instances ...11:34
StevenKAnd then two more DB patches. :-(11:35
czajkowskiis that all :)11:35
StevenKczajkowski: Nope. Then I have to land the branch that makes uses of the new columns.11:45
=== matsubara-afk is now known as matsubara
=== matsubara is now known as matsubara-lunch
=== slank_away is now known as slank
=== slank is now known as slank_away
=== slank_away is now known as slank
=== Ursinha-afk is now known as Ursinha
=== matsubara-lunch is now known as matsubara
=== almaisan-away is now known as al-maisan
=== gary_poster is now known as gary_poster|away
=== gary_poster|away is now known as gary_poster
=== al-maisan is now known as almaisan-away
=== deryck is now known as deryck[lunch]
=== broder_ is now known as broder
=== deryck[lunch] is now known as deryck
=== yofel_ is now known as yofel
sinzuiha. keyboard navigation is broken in the bugs subscriptions widget because it stomps on the content of it's overlay widget.19:33
sinzuiNow the question is, can I fix this without spending a 2 days remaking it as a true widget.19:33
* rick_h_ sends sinzui lots of luck19:37
sinzuiThis module is a crime19:38
rick_h_yea, my general rule in JS stuff is rewrite first ask questions later19:38
=== lifeless_ is now known as lifeless
timrcIs there a way to correlate a build with package_upload? I'm trying to see if I can calculate various wait time statistics between upload and build for our ppas21:36
StevenKA PackageUpload may link to a build, a source or a custom upload. I'm not certain if the property is exported.22:05
sinzuiStevenK, can you triage this: https://bugs.launchpad.net/launchpad/+bug/108961522:30
_mup_Bug #1089615: Source builds fail for packages with "3.0 (quilt)" format and unapplied patches <Launchpad itself:New> < https://launchpad.net/bugs/1089615 >22:30

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!