graph:remove() does not remove all triples in mdb store #3

Closed
opened 2026-01-16 22:22:41 +00:00 by scossu · 4 comments
Owner

Given a graph gr in MDB store with 48 triples:

>  #gr
48
>  gr:remove()
48
>  #gr
6
>  gr:remove()
6
>  #gr
0

It takes several attempts (some times more than 2) to clear all triples. Note that the remove() function returns the number of triples that should have been removed.

This does not seem to affect the hash table store.

The number of triples left behind is consistent across repetitions. It changes depending on the number of triples present.

Also, this only happens if all the arguments are not passed or are nil. Adding any term that is common to all triples results in a full removal.

Given a graph `gr` in MDB store with 48 triples: ```lua > #gr 48 > gr:remove() 48 > #gr 6 > gr:remove() 6 > #gr 0 ``` It takes several attempts (some times more than 2) to clear all triples. Note that the `remove()` function returns the number of triples that should have been removed. This does not seem to affect the hash table store. The number of triples left behind is consistent across repetitions. It changes depending on the number of triples present. Also, this only happens if all the arguments are not passed or are nil. Adding any term that is common to all triples results in a full removal.
Author
Owner

https://git.knowledgetx.com/scossu/volksdata/src/branch/master/test/test_graph.c#L585 passes, which seems to confirm that the issue is not with the underlying C library.

https://git.knowledgetx.com/scossu/volksdata/src/branch/master/test/test_graph.c#L585 passes, which seems to confirm that the issue is not with the underlying C library.
Author
Owner

A test generating the same number of random triples fails with different counts.

A test generating the same number of random triples fails with different counts.
Author
Owner

Actually, a new test with randomized values revealed that this problem is also present in the C library. Moving diagnosis one level lower.

Actually, a new test with randomized values revealed that this problem is also present in the C library. Moving diagnosis one level lower.
Author
Owner

Fixed in 7e424d1889.

Fixed in 7e424d1889.
Sign in to join this conversation.
No description provided.