-
Notifications
You must be signed in to change notification settings - Fork 20
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
bug: neo4j rasises neo4j.exceptions.DatabaseError exception when storing a large GraphQL query #4399
Comments
The problem is with this index: SHOW INDEXES where name = "node_range_attr_value_value";
╒═══╤═════════════════════════════╤════════╤═════════════════╤═══════╤══════════╤══════════════════╤══════════╤═════════════╤════════════════╤════════╤═════════╕
│id │name │state │populationPercent│type │entityType│labelsOrTypes │properties│indexProvider│owningConstraint│lastRead│readCount│
╞═══╪═════════════════════════════╪════════╪═════════════════╪═══════╪══════════╪══════════════════╪══════════╪═════════════╪════════════════╪════════╪═════════╡
│7 │"node_range_attr_value_value"│"ONLINE"│100.0 │"RANGE"│"NODE" │["AttributeValue"]│["value"] │"range-1.0" │null │null │0 │
└───┴─────────────────────────────┴────────┴─────────────────┴───────┴──────────┴──────────────────┴──────────┴─────────────┴────────────────┴────────┴─────────┘ This doc is for an earlier version of neo4j, but seems relevant: https://neo4j.com/developer/kb/index-limitations-and-workaround/
While we're not using the same exact index provider it seems to have the same size limit. A quick workaround can be to remove the index from the database, but there will probably be some performance penalty to this. DROP index node_range_attr_value_value; The problem is not related to the GraphQL query objects themselves, instead it's the value of any field. If we look at the definition of these objects as defined below a solution might be to set a size limit for the kinds Alternatively we reconsider the use of this index all together. {
"name": "GraphQLQuery",
"namespace": "Core",
"description": "A pre-defined GraphQL Query",
"include_in_menu": False,
"icon": "mdi:graphql",
"label": "GraphQL Query",
"default_filter": "name__value",
"order_by": ["name__value"],
"display_labels": ["name__value"],
"generate_profile": False,
"branch": BranchSupportType.AWARE.value,
"uniqueness_constraints": [["name__value"]],
"documentation": "/topics/graphql",
"attributes": [
{"name": "name", "kind": "Text", "unique": True},
{"name": "description", "kind": "Text", "optional": True},
{"name": "query", "kind": "TextArea"},
{
"name": "variables",
"kind": "JSON",
"description": "variables in use in the query",
"optional": True,
"read_only": True,
}, |
Great summary @ogenstad I'm leaning toward this solution
|
Fixed in #4412 |
Component
API Server / GraphQL
Infrahub version
0.16.0
Current Behavior
When you try to store a large GraphQL query in Infrahub (query used for a transformation synced into Infrahub, or a user create CoreGraphQLQuery object) you get a neo4j.exceptions.DatabaseError exception.
Expected Behavior
The CoreGraphQLQuery object gets created, or the user gets a proper error message.
Steps to Reproduce
Additional Information
The error message seems to be related to the fact we want to index the "query" attribute value. Not sure if that makes a lot of sense in the context of a GraphQLQuery.
The text was updated successfully, but these errors were encountered: