kuzudb / kuzu

Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
https://kuzudb.com/
MIT License
1.26k stars 89 forks source link

segfault error with `BEGIN TRANSACTION ... COMMIT` #3870

Closed sapalli2989 closed 1 month ago

sapalli2989 commented 1 month ago

Kùzu version

nightly

What operating system are you using?

Fedora 39

What happened?

Another occurrence of kuzu process hanging - I think at one point the Python debugger got me a segfault error: (Update: reproduced segfault error with Debian)

import kuzu
import tempfile
from uuid import uuid4

with tempfile.TemporaryDirectory() as dbpath:
    conn = kuzu.Connection(kuzu.Database(dbpath))
    conn.execute(
        """
        CREATE NODE TABLE V (id UUID, PRIMARY KEY (id));
        CREATE REL TABLE after ( FROM V TO V , ONE_ONE);
        """
    )

    id1 = uuid4()
    id2 = uuid4()

    conn.execute("BEGIN TRANSACTION")

    conn.execute(
        """
        CREATE (:V {id: $id1}), (b:V {id: $id2});
        """,
        {"id1": id1, "id2": id2},
    )

    result = conn.execute(
        """
        MATCH (ba:V)-[:after*0..]->(bb:V)
        return ba;
        """,
    )
    while result.has_next():
        print(result.get_next())

    conn.execute("COMMIT")

Remove the explicit BEGIN TRANSACTION ... COMMIT and it works again. This seems to be related to https://github.com/kuzudb/kuzu/issues/3845 , which has transaction issues as well (MVCC?).

Are there known steps to reproduce?

No response

sapalli2989 commented 1 month ago

One hint for other Fedora users: It seems, the kernel takes long time to perform a core dump in case of segmentation fault errors with Kuzu. This can easily be perceived as "process is hanging" or "program seems stuck in an infinite loop".

For Bash a way to disable core dumping and immediately get the segmentation fault error is to previously execute

ulimit -c 0

, which worked in my case.

andyfengHKU commented 1 month ago

This should be fixed in v0.5.0 release.