Skip to content

Conversation

@dmitchell
Copy link
Contributor

STUD-1039

@adampalay @cpennington please review

@nedbat
Copy link
Contributor

nedbat commented Dec 9, 2013

👍

1 similar comment
@adampalay
Copy link
Contributor

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand the structure here: Will this function end up removing the user from more than one group? If so, do we want a .save() for each group? Would it work to move the .save() to after the for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mechanically editing and not thinking as clearly as you :-) I've made the change on the branch I'm progressing for the other fixes.

@adampalay adampalay mentioned this pull request Dec 10, 2013
Conflicts:
	cms/djangoapps/auth/authz.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could just do user.groups.remove(*user.groups.filter(name__in=groupnames)), which should cut it down to a single remove query (although from the previous comments, there might only be one anyway)

@cpennington
Copy link
Contributor

👍

@dmitchell
Copy link
Contributor Author

Please review this next chunk of changes: @cpennington @chrisndodge Refactored loc mapper to use SON for subdocument queries and thus the default '_id' index. (I meant to put these on a different branch building on this one, mea culpa). As far as I can tell, this reduces the mongo time by about a factor of 2. I still need to implement memoization to get rid of most of the calls (I'll do that on a branch of this one this time).

Need to have @e0d add 2 more indexes to location_map on all mongo dbs:
ensureIndex({​'_id.org': 1, '_id.course': 1}{ background:true })
ensureIndex({​'course_id': 1}{ background:true })

@chrisndodge
Copy link
Contributor

@dmitchell looking. I see test failed, but it's a locked database error. Spurious error?!?

@chrisndodge
Copy link
Contributor

Just a clarification: as a high level summary, this just makes sure the queries are hitting the indicies (thus the perf increase). This doesn't reduce # of round trips. Right?

@dmitchell
Copy link
Contributor Author

Yes, the error looked unrelated to me too.

Yes, this just ensures that every query uses the indices. I'm going to impl memoization to ensure the queries don't repeat which will curtail the round trips.

@chrisndodge
Copy link
Contributor

re: memoization, we have in the code base a "request_cache", which is a cache which has a lifetime during the span of a request. I guess it should have been named "request_scoped_cache" :-) That might be helpful for you to do this.

@chrisndodge
Copy link
Contributor

Can we ding the branch again to get a clean test pass?

+1 but you should get @cpennington to go over it as well

@adampalay
Copy link
Contributor

@dmitchell , that first commit ( 01e66ec) is already in release. #1906

@cpennington
Copy link
Contributor

👍

@dmitchell
Copy link
Contributor Author

Changed to PR against master https://github.com/edx/edx-platform/pull/1954

@dmitchell dmitchell closed this Dec 13, 2013
@adampalay
Copy link
Contributor

@dmitchell we still want this against release because we're hotfixing off of this PR

@dmitchell dmitchell reopened this Dec 13, 2013
@adampalay adampalay closed this Dec 13, 2013
@dmitchell dmitchell deleted the dhm/release-1039_0 branch October 24, 2014 19:48
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Jun 23, 2017
* Fix bug 'self'. openedx#1904

* Add validation of email subject and body. openedx#1904

* Mod to get first record, if duplicate. openedx#1903

* Fix margin. openedx#1905

* Fix scrollbar and skip bok-choy. openedx#1906
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants