New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash while enforcing unique constraint on string property of nodes. #664
Comments
Related to this issue, we start from a fresh falkordb instance (pulled from the latest image as of this morning). Inserting a single node of type "Page" then adding additional nodes normally works. However, if you add and drop a constraint on the URL field, undefined behavior occurs. Either a segfault or the inserted URLs are malformed (resulting in UnicodeDecodeErrors when attempting to access.)
|
Seems like this is related to the index return from |
Thank you @linuxfreakus, @alan-salimov-vai |
Hi @linuxfreakus, @alan-salimov-vai we've been able to resolve both issues and are in progress of releasing these fixes. |
Summary
Currently we are running
FalkorDB 4.0.9
on Kubernetes in an HA sentinel mode setup and we have run into a problem with adding a unique constraint on node properties.We have nodes that have a URL property on them. Some of the URLs are pretty wonky and invalid, but nevertheless the strings made their way into the DB, and we desire to have no duplicate strings. There is already an index on the property because they are searched, but when we tried to add a unique constraint, it instantly crashes the database as well as all the replicas in our HA sentinel setup.
It appears that the constraint is added... and then replicated to the other nodes even though it is not operational yet... it then tries to enforce that constraint and crashes during the validation process, and the same thing happens on all other nodes, and unless there is intervention, the nodes will all continue to crash over and over since the constraint is in the AOF incremental file and it becomes necessary to either restore the PVC from backup, or modify the incr file to remove the offending issue.
It is not necessary to be using HA nodes to see this crash, but it is worth noting that the crash does take down the entire StatefulSet with it, so that might want to be considered when making a fix since it would be desirable to limit blast damage of things that resemble this situation (perhaps a config flag or something to control whether to replicate indices or constraints when they are not yet operational).
Also note that depending on what exactly is happening here in the code, it seems possible this could be exploited for denial of service or other malicious activity via specially crafted values (speculative, we have not tried to exploit).
Bug Report
Steps to Reproduce
Page
) with string property (i.e.url
) containing data that will trigger this issue (see attached)GRAPH.QUERY page "CREATE INDEX FOR (p:Page) ON (p.url)"
GRAPH.CONSTRAINT CREATE page UNIQUE NODE Page PROPERTIES 1 url
Attachments
dump.rdb.gz
The text was updated successfully, but these errors were encountered: