Temporarily disable bulk operations b/c old mongo
does too much work on exit and doesn't handle nesting
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -714,7 +714,8 @@ 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', [19, 6], 0), ('split', [2, 2], 0))
|
||||
# @ddt.data(('draft', [19, 6], 0), ('split', [2, 2], 0))
|
||||
@ddt.data(('draft', [18, 6], 0), ('split', [16, 2], 0)) # FIXME, replace w/ above when bulk reenabled
|
||||
@ddt.unpack
|
||||
def test_path_to_location(self, default_ms, num_finds, num_sends):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user