Open
Bug 1277432
Opened 9 years ago
Updated 8 years ago
Bugzilla::Memcached needs to support caching and clearing whole tables
Categories
(Bugzilla :: Database, enhancement)
Tracking
()
NEW
People
(Reporter: dylan, Assigned: h2014313059)
Details
Attachments
(1 file, 4 obsolete files)
|
750 bytes,
patch
|
Details | Diff | Splinter Review |
There are a few tables (yes, whole tables) that are reasonably small enough to store in memcached. Of these, fielddefs is a good target.
glob: The prefix / incr / etc stuff that is used to quickly invalidate cache, is that technique discussed somewhere? I'd like to make sure I understand its significance before adding anything else in there.
Flags: needinfo?(glob)
(In reply to Dylan William Hardison [:dylan] from comment #0)
> glob: The prefix / incr / etc stuff that is used to quickly invalidate
> cache, is that technique discussed somewhere?
tons of places, including the official faq: https://github.com/memcached/memcached/wiki/ProgrammingTricks#namespacing
Flags: needinfo?(glob)
note a lot of these sorts of tables, including fielddefs, already have IS_CONFIG => 1, so core 'load whole table' and cache invalidation mechanisms already exist.
https://github.com/mozilla/webtools-bmo-bugzilla/blob/master/Bugzilla/Object.pm#L414
of course making smarter use of this could be of value (priming the cache on startup, supporting filtered requests, etc).
| Reporter | ||
Comment 3•9 years ago
|
||
well, right now fielddefs is loaded from the db twice per request (for some requests, anyway).
My plan is to put caching in match() for Bugzilla::Field, for instance.
(In reply to Dylan William Hardison [:dylan] from comment #3)
> well, right now fielddefs is loaded from the db twice per request (for some
> requests, anyway).
> My plan is to put caching in match() for Bugzilla::Field, for instance.
sounds like a solid plan :)
Updated•9 years ago
|
Severity: normal → enhancement
| Reporter | ||
Updated•9 years ago
|
Assignee: database → h2014313059
| Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8796847 -
Flags: review?(dylan)
| Reporter | ||
Comment 6•9 years ago
|
||
Comment on attachment 8796847 [details] [diff] [review]
first patch
Please remove all the commented out code and submit another patch. :-)
Attachment #8796847 -
Flags: review?(dylan) → review-
| Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8796848 -
Flags: review?(dylan)
| Reporter | ||
Updated•9 years ago
|
Attachment #8796847 -
Attachment is obsolete: true
| Reporter | ||
Comment 8•9 years ago
|
||
note: ignoring those extra files. it was because of how we did a .git directory transplant.
| Assignee | ||
Comment 9•9 years ago
|
||
Attachment #8796849 -
Flags: review?(dylan)
| Reporter | ||
Updated•9 years ago
|
Attachment #8796848 -
Attachment is obsolete: true
Attachment #8796848 -
Flags: review?(dylan)
| Reporter | ||
Comment 10•9 years ago
|
||
Comment on attachment 8796849 [details] [diff] [review]
Third patch
I was too involved in discovering this fix, so I'm going to ask dkl to review it.
Attachment #8796849 -
Flags: review?(dylan) → review?(dkl)
Comment 11•9 years ago
|
||
Comment on attachment 8796849 [details] [diff] [review]
Third patch
Review of attachment 8796849 [details] [diff] [review]:
-----------------------------------------------------------------
This could be a future issue as our memcached instance limits keys to 250 characters in length. Certain where strings
can be longer than this and the key would be truncated to 250 silently. This could cause unintended key collisions is
some cases and we need to guarantee this doesn't happen. I would suggest we first hash the where string and use the
hash string in the key. Then use this to get/set. Or someother method if there is one better to guarantee uniqueness
but still always be under the size limit.
We could use something similar to how Bugzilla::Token::issue_hash_token uses md5_hex from Digest::MD5 to hash the where
string. Maybe give that a try first.
dkl
::: Bugzilla/Object.pm
@@ +381,5 @@
> && $class->IS_CONFIG)
> {
> + if ($where) {
> + $memcached_key = "$class:where:$where";
> + } else {
nit:
}
else {
Attachment #8796849 -
Flags: review?(dkl) → review-
| Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8807410 -
Flags: review?(dkl)
Attachment #8807410 -
Flags: feedback?(dylan)
| Assignee | ||
Comment 13•9 years ago
|
||
Attachment #8796849 -
Attachment is obsolete: true
Attachment #8807410 -
Attachment is obsolete: true
Attachment #8807410 -
Flags: review?(dkl)
Attachment #8807410 -
Flags: feedback?(dylan)
Flags: needinfo?(dylan)
Attachment #8807411 -
Flags: review?(dkl)
Comment 15•8 years ago
|
||
Comment on attachment 8807411 [details] [diff] [review]
Revised_patch
I cannot get to this at the moment. Dylan might be faster then I.
dkl
Attachment #8807411 -
Flags: review?(dkl) → review?(dylan)
You need to log in
before you can comment on or make changes to this bug.
Description
•