Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

nord-erik
Copy link

@nord-erik nord-erik commented Oct 8, 2025

Right before data is being written and right after scripts have been invoked we now call
cypher procedure "db.awaitIndexes".

This ensures that any custom indexes created from custom scripts will have leeway room to
finish construction before we write data.

Can be tweaked using option "index.await.timeout". Default 300, set to 0 for old behaviour
i.e. no wait.

@nord-erik nord-erik changed the title chore: add todo of initial idea feat: introduce global await for index creation Oct 9, 2025
@neo4j neo4j deleted a comment from neo4j-connectors Oct 9, 2025
@nord-erik nord-erik marked this pull request as ready for review October 9, 2025 08:36
@nord-erik nord-erik requested a review from a team as a code owner October 9, 2025 08:36
@nord-erik nord-erik force-pushed the en/db-await branch 2 times, most recently from 8d9cd37 to 3ad90e9 Compare October 9, 2025 11:29
@nord-erik nord-erik force-pushed the en/db-await branch 3 times, most recently from 415718e to ac3b083 Compare October 10, 2025 08:38
Copy link
Contributor

@venikkin venikkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Regarding testing, timeout is indeed hard to test. I think the best we can do is check query log or driver log that the valid statement is requested and rely on the database for the rest.

@nord-erik
Copy link
Author

I've managed to do a manual test setup, but need to further confirm. When calling db.awaitIndexes() after creating constraints, there seem to be a deadlock of some kind because awaitIndexes call completely blocks constraint creation. Will not merge yet

Right before data is being written and right after scripts have been invoked we now  call
cypher procedure "db.awaitIndexes".

This ensures that any custom indexes created from custom scripts will have leeway room to
finish construction before we write data.

Can be tweaked using option "index.await.timeout". Default 300, set to 0 for old behaviour
i.e. no wait.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.