Closed
Bug 132808
Opened 24 years ago
Closed 21 years ago
describekeywords.cgi blocks queries against the bugs database
Categories
(Bugzilla :: Bugzilla-General, defect, P3)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: myk, Assigned: gerv)
References
Details
Attachments
(1 file, 2 obsolete files)
|
1.03 KB,
patch
|
bbaetz
:
review+
myk
:
review-
|
Details | Diff | Splinter Review |
When describekeywords.cgi runs it blocks queries against the bugs database,
causing other script invocations (show_bug.cgi, process_bug.cgi, etc.) to hang
waiting for describekeywords.cgi to finish. For a large site like b.m.o., where
describekeywords.cgi can take 30-60 seconds to run, this seriously degrades
Bugzilla performance for the duration of the run. describekeywords.cgi should
not block other queries against the bugs database.
| Reporter | ||
Comment 1•24 years ago
|
||
I changed describekeywords.cgi on b.m.o. to use the shadow database, since it
appears that queries against the shadow database are not blocked by
describekeywords.cgi. I can't be sure of this, because I don't have a server
with enough load on it to test, but b.m.o. will tell us soon enough if this
solution doesn't work. In the meantime, here's the patch that does it.
| Reporter | ||
Comment 2•24 years ago
|
||
This patch works against the tip.
Comment 3•24 years ago
|
||
Comment on attachment 75587 [details] [diff] [review]
patch v2: against the tip
>diff -u -r1.7 describekeywords.cgi
>--- describekeywords.cgi 19 Feb 2002 23:32:04 -0000 1.7
>+++ describekeywords.cgi 22 Mar 2002 16:13:17 -0000
>@@ -32,7 +32,8 @@
>
> ConnectToDatabase();
>
>-quietly_check_login();
>+# Connect to the shadow database if this installation is using one.
>+ReconnectToShadowDatabase();
>
Whats wrong with ConnectToDatabase(1) ?
Attachment #75587 -
Flags: review-
Updated•24 years ago
|
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.16
Comment 4•24 years ago
|
||
-> patch author. this still has a needs-work on it, fyi.
Assignee: justdave → myk
| Assignee | ||
Comment 5•24 years ago
|
||
I think this is the right fix.
Gerv
| Assignee | ||
Updated•24 years ago
|
Attachment #75586 -
Attachment is obsolete: true
Attachment #75587 -
Attachment is obsolete: true
Comment 6•24 years ago
|
||
Comment on attachment 80451 [details] [diff] [review]
Patch v.3
r=bbaetz
Attachment #80451 -
Flags: review+
| Reporter | ||
Comment 7•24 years ago
|
||
Comment on attachment 80451 [details] [diff] [review]
Patch v.3
Unfortunately using the shadow database means locking that database up, which
doesn't gain us anything, so I have to needs-work this patch. The real
solution long-term is to generate a static version of these counts
periodically.
Attachment #80451 -
Flags: review-
Comment 8•24 years ago
|
||
Hang on. Yes, this query may take a long time. But so may any query. At least
this way you'd only block buglist.cgi, not show/enter/etc.
Even then, are you blocking? We don't lock the keywords table in that page, do
we? Its ok for numbers to be approximate. We should lock keyworddefs, for READ
access, but that hardly every changes.
Comment 9•24 years ago
|
||
I can't see how we are blocking anything significant. The shadow database is
designed to be read only, so you can have as many readers as you want, and as
many read locks as you want, on any tables.
The only thing that does get blocked by read locks is the synchronisations
(which are the only writes), but that's the point of the shadow database
tradeoff.
Comment 10•24 years ago
|
||
The select will effectivly result in built-in locking for that particular
statement, because of how mysql works. If we use the shadowdb, then we only
block queries which care about keywords, rather than show_bug and friends which
will use keywords.
myk: What do you get for: |SELECT COUNT(*) FROM keywords;|?
whats the explain output on the describekeywords.cgi sql?
We have to search through every entry on the keywords table - there's no short
cut for this.
Comment 11•24 years ago
|
||
Oh, and just out of interest - whats the time taken for the original query, and
the original query using INNER JOIN instead of LEFT JOIN? It should be roughly
the same.
| Reporter | ||
Comment 12•24 years ago
|
||
mysql> SELECT COUNT(*) FROM keywords;
+----------+
| COUNT(*) |
+----------+
| 61404 |
+----------+
1 row in set (0.00 sec)
mysql> EXPLAIN SELECT keyworddefs.name, keyworddefs.description,
COUNT(keywords.bug_id), keywords.bug_id FROM keyworddefs LEFT JOIN keywords ON
keyworddefs.id=keywords.keywordid GROUP BY keyworddefs.id ORDER BY keyworddefs.name;
+-------------+------+---------------+-----------+---------+----------------+------+---------------------------------+
| table | type | possible_keys | key | key_len | ref |
rows | Extra |
+-------------+------+---------------+-----------+---------+----------------+------+---------------------------------+
| keyworddefs | ALL | NULL | NULL | NULL | NULL |
130 | Using temporary; Using filesort |
| keywords | ref | keywordid | keywordid | 2 | keyworddefs.id |
810 | |
+-------------+------+---------------+-----------+---------+----------------+------+---------------------------------+
2 rows in set (0.00 sec)
| Reporter | ||
Comment 13•24 years ago
|
||
INNER JOIN has no effect on the query.
| Assignee | ||
Comment 14•24 years ago
|
||
So, it seems we have two options for b.m.o for 2.16 - use the shadowdb, or
disable the CGI. Which is it to be?
Gerv
| Reporter | ||
Comment 15•24 years ago
|
||
I don't think anything needs to be done about this bug for 2.16. Bug counts are
already disabled on b.m.o, but the permanent solution is likely to be either the
shadow database or (more likely) periodic generation of a static page. In the
meantime I can live with the local customization.
Pushing out to 2.18.
Target Milestone: Bugzilla 2.16 → Bugzilla 2.18
| Assignee | ||
Comment 16•23 years ago
|
||
Let's update the tip to use the shadowDB. I think that's reasonable, because of
what bbaetz said about the way MySQL works.
Gerv
Comment 17•22 years ago
|
||
Unloved bugs targetted for 2.18 but untouched since 9-15-2003 are being
retargeted to 2.20
If you plan to act on one immediately, go ahead and pull it back to 2.18.
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20
Comment 18•21 years ago
|
||
We don't use the shadowdb anymore. Anybody have any other good ideas for patches
for this?
Is it really still a problem?
Comment 20•21 years ago
|
||
Sounds like a WORKSFORME to me...
| Assignee | ||
Updated•21 years ago
|
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
Updated•20 years ago
|
Target Milestone: Bugzilla 2.20 → ---
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
•