Merge lp:~stevenk/launchpad/populate-bprc into lp:launchpad
Status: | Work in progress |
---|---|
Proposed branch: | lp:~stevenk/launchpad/populate-bprc |
Merge into: | lp:launchpad |
Diff against target: |
251 lines (+122/-4) 3 files modified
database/schema/security.cfg (+6/-0) lib/lp/scripts/garbo.py (+71/-2) lib/lp/scripts/tests/test_garbo.py (+45/-2) |
To merge this branch: | bzr merge lp:~stevenk/launchpad/populate-bprc |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+69412@code.launchpad.net |
Commit message
[r=allenap][bug=796997][incr] Add a garbo-hourly job that populates the BinaryPackageRe
Description of the change
Following on from https:/
Unmerged revisions
- 13486. By Steve Kowalik
-
Fix up DB perms a little better, and use testadmin to drop all BPFs.
The message that a BPR can't be added is now a warning. - 13485. By Steve Kowalik
-
Merge devel
- 13484. By Steve Kowalik
-
Stop logging success, fix how we determine when the population is done, and
correct Storm's misguided attempt at working out which tables are needed in
the inner select. - 13483. By Steve Kowalik
-
Merge devel, resolving conflicts.
- 13482. By Steve Kowalik
-
Switch from a non-working not in to a not exists subselect.
- 13481. By Steve Kowalik
-
Skip any BPRs that already have entries, fix dates, and change how done is
calculated. - 13480. By Steve Kowalik
-
Switch to self.done, rather than self.finish_at
- 13479. By Steve Kowalik
-
Fix getCandidateBPRs.
- 13478. By Steve Kowalik
-
Merge devel, resolving conflicts.
- 13477. By Steve Kowalik
-
Use the BPR directly and set the maximum chunk size to 20
[1]
+ maximum_chunk_size = 1
This is not allowing TunableLoop much scope for tuning the loop!
[2]
+ value = getUtility( IMemcacheClient ).get(' populate- bprc')
+ if not value:
+ self.start_at = 0
+ else:
+ self.start_at = value
Woah! :)
There are four memcache servers in production, all configured with the ackageReleaseCo ntents. __call_ _().
same weighting, so this code has a 3-in-4 chance that it will not
retrieve what was written at then end of the last time through
PopulateBinaryP
Also, memcache is expected to forget things. Combined with the above
gives a less than 1-in-4 chance of starting the loop again from where
it was last terminated.
[3]
+ def __call__(self, chunk_size): teBPRs( self.start_ at)[:chunk_ size]: lease.get( bprid)
+ for bprid in self.getCandida
+ bpr = BinaryPackageRe
getCandidateBPRs() returns BinaryPackageRe lease, not lease.id. There's something fishy going on in this
BinaryPackageRe
branch.
[4]
+ def isDone(self): teBPRs( self.start_ at)[:chunk_ size]:
+ return self.start_at > self.finish_at
+
+ def __call__(self, chunk_size):
+ for bprid in self.getCandida
I have a suggestion here:
def __init__(self, ...):
super(...)
self.done = False
def isDone(self):
return self.done
def __call__(self, chunk_size): getCandidateBPR s(self. start_at) [:chunk_ size])
bprs = list(self.
self.done = len(bprs) < chunk_size
for bpr in bprs:
...
[5]
+ def test_populate_ bprc(self) : ssLayer. switchDbUser( 'testadmin' )
+ LaunchpadZopele
Perhaps self.layer. switchDbUser( ...)?
Also, this test seems fairly fragile, and very dependent on test
data. Soyuz is a bit special in that respect, but don't cheat too much
;) If you have any doubt can you run this past bigjools?