Closed Bug 993939 Opened 11 years ago Closed 11 years ago

Bugzilla::User::Setting::groups() should use memcached

Categories

(Bugzilla :: Bugzilla-General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: glob, Assigned: glob)

Details

(Keywords: bmo-goal, perf)

Attachments

(1 file)

$user->groups() is called for each commenter in a bug. this results in frequent database calls for data that changes very infrequently, making it an ideal candidate for memcached. implementation notes: - in Bugzilla::User::groups() - build a cache key "user_groups.$user_id" - wrap the db check and tree walking with memcached->get_config and set_config (follow how $membership_rows is cached) - in Bugzilla::User::update() - call memcached->clear_config({ key => "user_groups.$user_id" }) if login_name changed - in editusers.cgi - call memcached->clear_config({ key => "user_groups.$user_id" }) if $action is update
Severity: normal → enhancement
Keywords: bmo-goal
Status: NEW → ASSIGNED
QA Contact: default-qa → glob
Assignee: general → glob
QA Contact: glob
Attached patch 993939_1.patchSplinter Review
- stores and checks a user's group membership in memcached - extends memcached->clear_config to support clearing individual keys - clears the cached value in $user->derive_regexp_groups() - clears the cached value in edituser when groups membership is changed - changes memcached's prefix delimiter from : to . to avoid escaping, making keys easier to read when debugging
Attachment #8415777 - Flags: review?(dkl)
Comment on attachment 8415777 [details] [diff] [review] 993939_1.patch Review of attachment 8415777 [details] [diff] [review]: ----------------------------------------------------------------- Works as expected. r=dkl
Attachment #8415777 - Flags: review?(dkl) → review+
Flags: approval?
Target Milestone: --- → Bugzilla 5.0
Flags: approval? → approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git ccff248..6d730fa master -> master
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
this broke the build: https://travis-ci.org/bugzilla/bugzilla/jobs/26188673 Can't call method "get" on an undefined value at Bugzilla/Memcached.pm line 187.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 6d730fa..b5b5061 master -> master
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: