memgraph / mage

MAGE - Memgraph Advanced Graph Extensions :crystal_ball:
Apache License 2.0
244 stars 24 forks source link

QM collections.remove_all fail in concurrent execution #378

Closed antejavor closed 6 months ago

antejavor commented 10 months ago

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 commented 10 months ago

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.

antoniofilipovic commented 10 months ago

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

katarinasupe commented 8 months ago

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

antoniofilipovic commented 6 months ago

Yes, done