Closed
Bug 232897
Opened 22 years ago
Closed 22 years ago
collectstats.pl tries to delete from shadow database
Categories
(Bugzilla :: Reporting/Charting, defect)
Bugzilla
Reporting/Charting
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: myk, Assigned: gerv)
References
Details
(Whiteboard: [fixed in 2.17.7])
Attachments
(1 file)
1.46 KB,
patch
|
bbaetz
:
review+
|
Details | Diff | Splinter Review |
Over on line 57 collectstats.pl switches to the shadow database, then on line
479 CollectSeriesData() tries to delete some data without switching back to the
main database. This corrupts data on systems that give Bugzilla write access to
their shadow database. On b.m.o it just causes collectstats.pl to die, which is
what it has been doing on b.m.o every night since the upgrade last week.
Assignee | ||
Comment 1•22 years ago
|
||
Yes... when collectstats.pl was just doing queries, this made sense. Now, of
course, it does writes (not just deletes) and so we can't use the shadowdb any more.
My suggested course of action is just to remove the switch to the shadowdb. Does
that sound right?
Gerv
Reporter | ||
Comment 2•22 years ago
|
||
How expensive are the queries collectstats.pl runs?
Assignee | ||
Comment 3•22 years ago
|
||
It depends - users can choose any arbitrary query to be charted. However, unless
they are admins, they can't set the frequency to more than once a week.
An alternative implementation might be to switch between the shadow and real
databases every time one read or wrote (or to batch up the results and switch,
say, ever ten.) How expensive is switching databases?
Gerv
Reporter | ||
Comment 4•22 years ago
|
||
>How expensive is switching databases?
Not sure. bbaetz- do you know?
Comment 5•22 years ago
|
||
You can't switch. What you can do is get a separate db handle to the shadowdb,
and just use the appropriate one. If you're not using the shadowdb, then both
handles will be the same, so be careful of locking/ordering issues.
Assignee | ||
Comment 6•22 years ago
|
||
bbaetz: what sort of locking/ordering mistakes are possible?
Gerv
Comment 7•22 years ago
|
||
No more than usual. Just that if you test where the dbhs are the same, a LOCK
WRITE in one, a SELECT in the second will work, but it won't work if you have a
shadowdb,
Assignee | ||
Comment 8•22 years ago
|
||
*** Bug 233403 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 9•22 years ago
|
||
This works on my machine - but it needs careful review to see what would happen
when we have a shadowdb.
Gerv
Assignee | ||
Updated•22 years ago
|
Attachment #141099 -
Flags: review?(bbaetz)
Assignee | ||
Updated•22 years ago
|
Attachment #141099 -
Flags: review?(myk)
Comment 10•22 years ago
|
||
Comment on attachment 141099 [details] [diff] [review]
Patch v.1
Hmm. We need to think about how |switch_to_*| can work with modperl...
I argued against direct accessors in bug 163290 comment 8, but I'm not so sure
any more. I wasn't really planning for this sort of usage for the shadowdb.
Anyway, thats a different issue, and this script doesn't need to care about mod
perl anyway.
Attachment #141099 -
Flags: review?(bbaetz) → review+
Assignee | ||
Updated•22 years ago
|
Flags: approval?
Updated•22 years ago
|
Flags: approval? → approval+
Whiteboard: [wanted for 2.17.7]
Assignee | ||
Comment 11•22 years ago
|
||
Fixed.
Checking in collectstats.pl;
/cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v <-- collectstats.pl
new revision: 1.35; previous revision: 1.34
done
Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.18
Assignee | ||
Updated•22 years ago
|
Attachment #141099 -
Flags: review?(myk)
Updated•22 years ago
|
Whiteboard: [wanted for 2.17.7] → [fixed in 2.17.7] [applied to b.m.o]
Updated•21 years ago
|
Whiteboard: [fixed in 2.17.7] [applied to b.m.o] → [fixed in 2.17.7]
Updated•13 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•