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

wallyworldbut the whole method can be refactored since it duplicates the override stuff00:00
wallyworldnot just for unknown files00:00
wallyworldthe policy can be got : override_policy = self.policy.archive.getOverridePolicy()00:01
wallyworldand then the adaptor can be used00:01
StevenKwallyworld: Approved00:01
wallyworldthans00:01
=== Ursinha is now known as Ursinha-afk
StevenKwallyworld, wgrant: https://code.launchpad.net/~stevenk/launchpad/send-host-header-during-getremotebug/+merge/13244704:39
wgrantStevenK: The Host header doesn't work like that04:39
StevenKwgrant: Yes it does? We need to instruct the remote site which one we're talking to.04:40
wgrant+        return {'User-agent': LP_USER_AGENT, 'Host': self.baseurl}04:41
wgrantI spy with my little eye a contradictory statement04:41
wgrant(host != URL)04:42
StevenKBleh04:42
StevenKwgrant: Changes pushing, thanks.04:46
StevenKDiff updated.04:49
wgrantThanks04:50
wallyworldwgrant: since you ran the queries on DF, if you get a moment at some point, could you look at this for me? https://code.launchpad.net/~wallyworld/launchpad/person-index-timeout-931771/+merge/13244605:39
wgrantwallyworld: Sure05:40
wallyworldthanks, no hurry05:41
StevenKBlink05:41
StevenKdb-devel died05:41
wallyworldwhat?05:41
StevenKsubunit corruption, looks like05:45
wallyworld\o/05:48
wallyworldwgrant: can tables be created live with no locks? i can't see why not05:56
wgrantwallyworld: Only if they have no foreign keys05:57
wallyworldit does, but the table will be empty05:58
wgrantAdding a foreign key creates an internal trigger on both ends, which requires an access exclusive lock05:58
wallyworldsurely only for a micro second05:58
wgrantRight, as with most ALTER TABLEs it's basically instantaneous05:58
wallyworldbut we still cannot create live?05:59
wgrantNot without delaying things for maximum_txn_length * 205:59
wallyworldit would be no worse than may of our transactions05:59
wgrantthe ALTER TABLE will request an exclusive lock on the table05:59
wgrantthis will wait around until all existing transactions finish05:59
wgrantthe pending, ungranted lock will block any new transactions that want to use the table06:00
wgrantOnce all the existing transactions finish, the lock can be taken and then released06:00
wgrantBut we have lots of long transactions, so this could block everything for minutes or even longer06:00
StevenKAnd given FDT is not really an issue06:00
wallyworldok, FDT it is06:00
StevenKWhat new table?06:01
wallyworldfor recording the latest published sources06:01
wallyworldsource packages06:01
StevenKBTF for source packages?06:01
wallyworldBTF?06:01
StevenKBugTaskFlat06:02
wallyworldwell, not really06:02
wallyworldbut it is a denorm of the data model for reporting06:02
wallyworldit will be maintained by a garbo frequently job initially06:02
wallyworldthe business logic changes to consume it are trivial, and actually reduce LOC I think06:03
=== deryck_ is now known as deryck
=== Ursinha-afk is now known as Ursinha
stubwallyworld: You are missing foreign key definitions in that MP. Is that deliberate or an oversight?09:34
wallyworldstub: deliberate09:34
wallyworldit's only a reporting table09:34
wallyworldso i didn't want to do anything to slow down performance09:34
wallyworldAFAIK, BugTaskFlat has no FKs also09:35
wallyworldbt i could be wrong09:35
stubYeah, but it is maintained entirely by triggers to enforce referential integrity09:35
wallyworldi'm happy to add them if they are required09:35
wallyworlddo the triggers even check for missing references?09:36
stubwallyworld: They are not required, but leaving them out is a potential foot gun09:36
wallyworldeg with BugTaskFlat, what happens if a referrenfed object is deleted?09:36
wallyworldi don't think that is caught09:36
stubIt should be09:36
wallyworldshould be or is?09:37
wallyworldi'll add the FK references to the mp though09:37
stubit should be, as that is what was supposed to happen when I reviewed it IIRC09:37
wallyworldo09:37
stubOtherwise we would be giving out incorrect results (the footgun)09:37
wallyworldok09:37
stubSo here for instance, missing FK to the person table could mean packages get lost when a person merge happens.09:38
wallyworld so i just need to update the table definition to say REFERENCES foo, nothing else?09:38
stubDeclaring them 'on delete cascade' may be useful, or may be a big problem09:38
stubwallyworld: yes09:38
stuboh, haven't finished looking at it yet :)09:39
wallyworldok09:39
stubwallyworld: Yeah, all looks fine apart from the FK issue09:43
wallyworldstub: what about the archive.purpose column?09:43
wallyworldwhich is an enum09:43
wallyworlddo i need a fk there too?09:43
stubwallyworld: If they are a problem, we can leave them out but we have to think hard about potential problems09:43
stubwallyworld: no09:44
wallyworldbah, archive_purpose09:44
wallyworldjust about to push changes09:44
wallyworldthanks for looking09:44
stubAnd now I read your statement about FKs in the MP :-/09:48
wallyworldstub: changes pushed09:51
wgrantstub, wallyworld: That table definitely needs foreign keys09:51
wallyworldthey are there now :-)09:52
wgrantBugTaskFlat doesn't, since it's maintained entirely inline by triggers on FKed tables09:52
wallyworldso i will need to update the person merge code when i do the devel work09:52
wgrantAnd there's a one-to-one relationship between BugTask and BugTaskFlat09:52
wgrantwallyworld: Possibly09:52
wgrantwallyworld: Person merge will crash (and tests will fail) if you add a new person FK that's involved in a unique constraint09:53
stuboh, archive_purpose needs to remain in sync with Archive.purpose?09:53
wallyworldyes09:53
wgrantArchive.purpose doesn't change09:53
wgrantwallyworld: Should dateuploaded and publication be NOT NULL?09:54
wgrantAlso, that table name is far too generic09:54
wallyworldwgrant: publication is a reference to SPPH09:54
wgrantwallyworld: Sure09:54
wgrantIt still needs to be NOT NULL09:54
wallyworldoh, i meant to put not null09:54
wgrantIt also can't be the PK09:54
wgrantAs it's mutable09:55
wallyworldi thought primary keys were automatically not null09:55
wgrantWell, it could be the PK, but Storm will kill you in your sleep if you try to change it09:55
wallyworldah, right. i was thinking the pib reference would not change09:55
wallyworldpublication i mean09:55
wallyworldbut it can of course09:55
wallyworldi'd add a surrogate key09:56
wgrantThe natural key is (person, archive, distroseries)09:56
wallyworldwhich person?09:56
wgrantThat's the question09:56
wallyworldcreator?09:56
wgrantI'm not quite sure that this schema does what we need; we'll probably want a complete garbo+browser implementation reviewed before this landss09:57
wallyworldi did the natural key as spn, archive, distroseries09:57
wgrantEr, yeah, spn needs to be in there as well09:57
wgrantBut person obviously has to be too09:57
wallyworldnot obvious to me :-)09:57
wgrantHm?09:57
wallyworldsince i don;t know soyuz that well09:57
wgrantWhy not?09:57
wgrantWe care about the person's latest package09:58
wgrants09:58
wallyworldi thought only one person would publish a spn, archive, distroseries09:58
stubhttp://paste.ubuntu.com/1323048/ enforces the purpose can't get changed on archive09:58
wgrantwallyworld: Only one person's publication will be current, sure09:58
wgrantBut this shows superseded ones too09:58
wallyworldthanks stub, will add that09:58
wallyworldah, ok09:58
wallyworldso creator i suppose is the person to use09:59
wgrantWell09:59
stubhttp://paste.ubuntu.com/1323050/ is probably better, or it will be a PITA to change the purpose of an archive09:59
wgrantIt probably needs to be both09:59
StevenKstub: We never want to change the purpose of an archive.09:59
StevenKIt is by all accounts immutable10:00
wgrantRight, archive purposes cannot change without manual SQL10:00
wgrantI don't think one has ever changed10:00
wgrantIt doesn't make sense10:00
wallyworldstub: is the preference to add constraints inline or use an alter table?10:00
wgrantIf one wants to change, we have bigger problems10:00
stubSo probably no need for the extra index and multi column FK constraint10:00
wgrantThis is a cache table that is cheap to regenerate and unproblematic if it breaks10:00
stubwallyworld: technically it makes no difference. I find it all inline more readable myself.10:00
wallyworldnp, thanks10:01
wallyworldstub: with the comments, there's a comments.sql - does that get rolled up at some point?10:02
StevenKcomments.sql no longer gets applied to production, either10:02
deryckczajkowski, did the lp session get dropped today?10:02
stubwallyworld: The comments should go in comments.sql sorry.10:03
czajkowskideryck: it did, there was no other sign ups and didnt want to waste the lP dev time10:03
wallyworldstub: ok, i saw some other patches contained them, so wasn;t sure10:03
deryckczajkowski, ah, ok.  Thanks for putting those sessions together.10:03
czajkowskino worires thanks for coming ;)10:04
stubyeah, and your question made me question that.10:04
wallyworldstub: i thought it might be like patches - at some point, a rollup is done if you know what i mean10:04
wallyworldso add everything to the patch, incl comments10:04
stubyeah, but we haven't written any code to do that rollup10:04
* stub thinks10:05
wallyworldok, will just add to comments.sql then10:05
stubwallyworld: nah10:05
stubwallyworld: leave them where they are. The rollup will happen10:05
wallyworldok10:05
stubI should apply comments.sql to production and then nuke it so I don't confuse myself again10:06
wallyworldwgrant: i'll add both creator and maintainer to the natural key for now and we can rethink before landing10:06
wgrantThe schema will likely need to evolve once we discover that the code cannot use it10:07
stubreading scrollback, the natural key is complex enough to warrent just using an 'id' serial column10:07
wallyworldyeah, adding10:08
wallyworldi never use natural key as pk10:08
wallyworldi only ever add a constraint to enforce it10:08
wallyworldi mistakenly thought i could use the publication reference as the pk, thinking there was a 1-1 relationship10:09
wgrantThis table will never be referenced in an FK, so a natural key makes a reasonable amount of sense, but it's not going to run off the end of a 32-bit int any time soon, so it doesn't matter much either way10:09
wgrantBut we should avoid surrogate keys when we can :)10:09
wallyworldi disagree :-)10:09
wgrantAh, so it was you who designed branchrevision :P10:10
wallyworldsurrogate keys form the basis of good db design10:10
wgrantAnd oauthnonce10:10
wallyworldnot for join tables necessarily10:10
wallyworldbut for straight up entity tables, yes10:10
wgrantSurrogate keys for things that need to be referenced by FKs, sure10:10
wgrantThis isn't an entity table10:11
wgrantAs such10:11
wallyworldsure10:11
wallyworldwhat would you prefer the table name to be?10:11
wgrantSomething involving person, sourcepackagerelease, and cache, probably.10:11
wgrantLatestPublishedReleases doesn't mean anything10:12
wgrantWhat do we do when we want a table showing the latest releases for a product, or binarypackagereleases, or...10:12
wallyworldshouldn't the table name contain 'latest'?10:12
wgrantProbably10:12
wallyworldi thought all releases went into spph10:12
wallyworldand spr10:12
wgrantSource package releases go into SPR and SPPH10:13
wgrantBinary package release don't10:13
wgrantProduct releases don't10:13
wallyworldi didn't know there were any other kinds10:13
wgrantBecause they're not source package releases :)10:13
wallyworldok, i know that *now* :-)10:13
wallyworldremember, i am a soyuz virgin10:13
wgrantProduct releases aren't Soyuz10:13
wgrantThey're Registry10:14
wgrant:)10:14
wallyworldwell, clearly i have a lot to learn in this domain area10:14
wallyworldstub: ignoring the tablename etc, is this correct for creating the surrogate id? https://pastebin.canonical.com/77517/10:18
wgrant"id serial PRIMARY KEY"10:20
wgrantis all you need10:20
wgrantIt will autocreate the sequence etc10:21
wgrantwallyworld: ^^10:22
wallyworldok10:22
wallyworldwas the stuff i used just old code?10:23
wgrantThat's probably how they appear in dumps10:23
wgrantserial maps to that10:23
wallyworldok10:23
wallyworldi looked at our sql files though10:24
wgrantBut serial has been around forever. Doing it manually is not so much "old" as "positively ancient"10:24
wgrantThe base schema? That's pg_dump output10:24
wgrantNot manually written10:24
wallyworldnot sure where i found it now, probably10:24
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== jcsackett changed the topic of #launchpad-dev to: http://dev.launchpad.net/ | On call reviewer: jcsackett | Firefighting: - | Critical bugs: ~200
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== matsubara is now known as matsubara-lunch
sinzuijcsackett, do you have time to review https://code.launchpad.net/~sinzui/launchpad/reimport-inactive-templates/+merge/13242115:55
jcsackettsinzui: sure.15:55
jcsackettsinzui: looks good, just want to make sure that the first check returning `entry` if true and others returnin None is intentional?16:08
sinzuiyes, because we do not want to tamper with it16:09
jcsackettsinzui: ok, that's what i thought, but i figured i would double check.16:09
jcsackettsinzui: r=me.16:10
sinzuithank you16:10
=== beuno is now known as beuno-lunch
=== beuno-lunch is now known as beuno
czajkowskicjwatson: people think you sleep! little do they know!16:52
=== Ursinha is now known as Ursinha-afk
=== matsubara-lunch is now known as matsubara
sinzuiabentley, I think your PRF bug and my person merge bug can be fixed in the same branch17:37
abentleysinzui: Mine's already landing via EC2.18:49
sinzuiexcellent18:49
sinzuiI am moving SELECT to the script group so that no script needs basic access18:49
sinzuiI will resolve conflicts with your branch18:50
abentleysinzui: thanks.18:50
jcsackettsinzui: does the db buildbot failure prevent regular devel landings? pqm is yelling about my commit msg not satisfying the testfix requirement but it doesn't look like we should need one...19:39
sinzuijcsackett, one failure breaks both. You need to land a fix correct builder or force a build for spurious19:54
jcsackettsinzui: ah. for some reason i thought they were separate.19:54
sinzuijcsackett, Do you have time to review a branch https://code.launchpad.net/~sinzui/launchpad/merge-db-permissions/+merge/13261520:07
jcsackettsinzui: looking now.20:08
jcsackettsinzui: r=me.20:10
sinzuithank you20:11
abentleyjcsackett: Could you please review https://code.launchpad.net/~abentley/launchpad/fix-assignment-list/+merge/132621 ?20:48
jcsackettabentley: sure.20:49
jcsackettabentley: that was short. :-) r=me.20:50
abentleyjcsackett: Thanks.20:50
abentleyjcsackett: If only all critical bugs were so simple to fix :-)20:50
jcsackettabentley: i hear that.20:50
=== jcsackett changed the topic of #launchpad-dev to: http://dev.launchpad.net/ | On call reviewer: - | Firefighting: - | Critical bugs: ~200
=== almaisan-away is now known as al-maisan
=== al-maisan is now known as almaisan-away

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