-
Notifications
You must be signed in to change notification settings - Fork 25
rebase and upgrade neo4j 2025.03.0 #6336
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
Conversation
CodSpeed Performance ReportMerging #6336 will not alter performanceComparing Summary
|
95613a5
to
950688a
Compare
Workaround until we update the sdk to use the latest testcontainers. Signed-off-by: Fatih Acar <[email protected]>
950688a
to
bcee032
Compare
25% improvement according to the testing framework on the TestSite test. @wartraxx51 I squashed some commits in the branch after my own review. |
Signed-off-by: Fatih Acar <[email protected]>
503f19d
to
054fb15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow. this must have been very painful. very impressive.
it might be worth opening a 1.3
issue to make sure we do one final pass for any CALL
subqueries added in stable
and merged forward
MATCH (a)-[ve:IS_VISIBLE]->(v) | ||
WITH a, ve, v | ||
WITH ve, v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised by this one, make sense to remove the first line but later aren't we gonna loose the variable if we don't include it in WITH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior changes with the new syntax.
According to: https://neo4j.com/docs/cypher-manual/current/subqueries/call-subquery/#variable-scope-rules
The scope clause’s variables can be globally referenced in the subquery. A subsequent WITH within the subquery cannot delist an imported variable. The deprecated importing WITH clause behaves differently because imported variables can only be referenced from the first line and can be delisted by subsequent clauses.
It would be indeed lost with the previous WITH
method.
.github/workflows/ci.yml
Outdated
@@ -409,6 +409,7 @@ jobs: | |||
timeout-minutes: 45 | |||
env: | |||
INFRAHUB_DB_TYPE: neo4j | |||
NEO4J_DOCKER_IMAGE: "neo4j:2025.03.0-community" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it required to define the version in GHA action or was it mainly for testing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was required to make the CI pass.
The issue here is that we depend on the Infrahub SDK which imports an old infrahub-testcontainers version (with the previous neo4j version). That makes the docker integration tests fail with the new backend code...
Should we publish an alpha version of testcontainers, then an alpha version of the SDK, and then make develop
point to the alpha SDK instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should use the local version of infrahub-testcontainers
, otherwise this issue will keep coming up when we have to change the docker compose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the environment variable that was forcing the database version in the last commit and this part of ci
@@ -34,6 +34,7 @@ jobs: | |||
include: | |||
- name: From 1.1.0 | |||
source_version: 1.1.0 | |||
neo4j_image: "neo4j:5.20.0-enterprise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, is it required to set the version here,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we rely on the development/docker-compose.yml
stuff for the upgrade test job, we must start the previous Infrahub version with the previous neo4j version.
I don't know any other way to do that except specifying the neo4j docker image to use when starting the previous Infrahub version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one make sense
CREATE (a:Attribute { uuid: attr.uuid, name: attr.name, branch_support: attr.branch_support }) | ||
CREATE (n)-[:HAS_ATTRIBUTE { branch: attr.branch, branch_level: attr.branch_level, status: attr.status, from: $at }]->(a) | ||
MERGE (av:AttributeValue { value: attr.content.value, is_default: attr.content.is_default }) | ||
WITH n, attr, av, a | ||
WITH av, a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised about this one too
@@ -137,12 +137,11 @@ async def query_init(self, db: InfrahubDatabase, **kwargs: Any) -> None: # noqa | |||
# ruff: noqa: E501 | |||
query = """ | |||
// get attributes for node and its relationships | |||
CALL { | |||
CALL () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels like this shouldn't be empty, most likely we need to investigate what is generated as part of select_subqueries_str
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is legit: the whole query starts with a subquery, so there are no variables to import at this stage.
Signed-off-by: Fatih Acar <[email protected]>
Good point, I created IFC-1482 internally. |
c000862
to
adf373f
Compare
Thanks @wartraxx51 on the help here, I think we can merge this PR now. |
This is a rebase of the work done by @fatih-acar #5241 from the develop branch for the upgrade of Neo4j from version 5.20.0 to 5.26.5.
There is a clear improvement in performance.