Merge remote-tracking branch 'origin/release' into adam/resolve-merge-conflicts

Conflicts:
	common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
This commit is contained in:
Adam Palay
2014-09-05 13:18:57 -04:00
10 changed files with 46 additions and 11 deletions

View File

@@ -566,6 +566,14 @@ class ModuleStoreReadBase(ModuleStoreRead):
finally:
self._end_bulk_operation(course_id)
@contextmanager
def bulk_temp_noop_operations(self, course_id):
"""
A hotfix noop b/c old mongo does not properly handle nested bulk operations and does unnecessary work
if the bulk operation only reads data. Replace with bulk_operations once fixed (or don't merge to master)
"""
yield
def _begin_bulk_operation(self, course_id):
"""
Begin a bulk write operation on course_id.

View File

@@ -68,7 +68,8 @@ def path_to_location(modulestore, usage_key):
newpath = (next_usage, path)
queue.append((parent, newpath))
with modulestore.bulk_operations(usage_key.course_key):
# FIXME replace with bulk_operations once it's fixed for old mongo
with modulestore.bulk_temp_noop_operations(usage_key.course_key):
if not modulestore.has_item(usage_key):
raise ItemNotFoundError(usage_key)

View File

@@ -901,7 +901,7 @@ class TestMixedModuleStore(unittest.TestCase):
# TODO: LMS-11220: Document why draft send count is 5
# TODO: LMS-11220: Document why draft find count is [19, 6]
# TODO: LMS-11220: Document why split find count is [2, 2]
@ddt.data(('draft', [21, 6], 0), ('split', [2, 2], 0))
@ddt.data(('draft', [18, 5], 0), ('split', [16, 6], 0)) # FIXME, replace w/ above when bulk reenabled
@ddt.unpack
def test_path_to_location(self, default_ms, num_finds, num_sends):
"""