mage icon indicating copy to clipboard operation
mage copied to clipboard

QM collections.remove_all fail in concurrent execution

Open antejavor opened this issue 2 years ago • 3 comments

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;

antejavor avatar Oct 09 '23 12:10 antejavor

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.

antejavor avatar Oct 09 '23 12:10 antejavor

The fix is coming here: https://github.com/memgraph/mage/pull/393

antoniofilipovic avatar Oct 17 '23 09:10 antoniofilipovic

@antoniofilipovic is this done? Can the issue be closed?

katarinasupe avatar Dec 27 '23 15:12 katarinasupe

Yes, done

antoniofilipovic avatar Feb 27 '24 14:02 antoniofilipovic