QM collections.remove_all fail in concurrent execution
Describe the bug
Running collections.remove_all(LABELS(node) in a concurrent fashion crashes Memgraph.
[2023-10-06 05:44:11.719] [memgraphlog] [critical]
Assertion failed in file /memgraph/src/utils/memory.cpp at line 236.
Expression: 'it != chunks.end()'
Message: 'Failed deallocation in utils::Pool
To Reproduce Run the following query: MATCH (node:Application) WHERE size(collections.remove_all(LABELS(node), ["_BloomPerspective","FunctionalId","RefactorVersion"])) = 2 AND collections.remove_all(LABELS(node), ["_BloomPerspective","FunctionalId","RefactorVersion","Application","Process"]) = [] RETURN node{.uuid} as key , node{.name,.uuid,.pid,.startTime} as fingerprint ORDER BY node.uuid ASC LIMIT 50000;
Probably memory needs mgp::MemoryDispatcherGuard guard(memory); https://github.com/memgraph/mage/blob/main/cpp/collections_module/collections_module.cpp#L7
Which is causing a wrong deallocation.
The fix is coming here: https://github.com/memgraph/mage/pull/393
@antoniofilipovic is this done? Can the issue be closed?
Yes, done