Skip to content

Incorrect "Incomplete nodes left" error during database initialization #325

@Vogel612

Description

@Vogel612

When initializing a database adapter to a complex database, the error message "Incomplete nodes left: [foo, bar]" is output. When debugging I have determined that the error message is generated in rd-lib-common's DependencyModel as called from DBUtil (in rd-lib-jdbacl).

The root cause of the issue seems to be that the DependencyModel incorrectly assumes that traversed incomplete nodes never become INITIALIZABLE during the traversal of other incomplete nodes during postProcessNodes. c.f.:

https://github.com/rapiddweller/rd-lib-common/blob/d123bd25ac103aa95f7292f1b6a117660f6087d9/src/main/java/com/rapiddweller/common/depend/DependencyModel.java#L100-L123

I unfortunately cannot provide a database schema for reproduction purposes, but the debugging yields a moderate amount of tables involved. When the issue finally manifests I have:

  • 33 heads
  • 174 tails
  • 161 orderedNodes
  • 2 incomplete Nodes (both in state INITIALIZABLE)

The first iteration of partially initializable nodes adds 61 nodes to the incompletes (when there are only 22 pending remaining).
Before the final call to postProcessNodes there are 11 incompletes, of which the 2 that remain after are PARTIALLY_INITIALIZED, the 9 others are INITIALIZABLE.

Unfortunately my understanding of the DependencyModel algorithm is insufficient to help generate a debuggable MCVE for reproduction purposes. I expect that repeating the call to postProcessNodes so long as the number of incompletes has changed is sufficient to fix the issue.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions