You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Progressive inconsistencies between Dependency Track database and lucene indexes #2235
Overtime, the content of dependency track lucene drift from the database because of several factors :
Lucene indexes are updated asynchronously and can thus fail due to a lot of reasons (apiserver restart, I/O issues,...) whereas DB is correctly updated
1.Create a project
2.Upload a SBOM
3.Check that lucene component index is updated using API /api/v1/search/component
4.Recursively delete the project
5.Check that lucene component index is untouched using API /api/v1/search/component (Same results as in step 3)
Expected Behavior
Dependency Track database is as consistent as possible with Dependency Track Lucene index without resorting to multiple index rebuild
Is this something that can be fixed entirely, or do we just have to accept that there will always be a certain drift / lag? I reckon #2200 reduces the drift for the most part (depending on portfolio activity, the drift could still be significant).
Even if we add more index update operations, the point you made here will still be true:
Lucene indexes are updated asynchronously and can thus fail due to a lot of reasons (apiserver restart, I/O issues,...) whereas DB is correctly updated
Just wondering if we can assume this issue to be fixed once #2200 is merged, or whether we need to go harder on properly maintaining the indexes in order to resolve it.
By design, there will always be an unwanted drift. However, I feel like we can spend some time reviewing the database update flow to identifiy trivial gaps to fill like the example given in the description.
Maybe also improve the implementation to make indexing easier, straightforward and oversight resistant. I'm thinking about DN Lifecycle listeners and Transaction synchronization to automatically hook into entities update and DN commit/rollback.
Activity
nscuro commentedon Dec 6, 2022
Thanks for reporting @syalioune!
Is this something that can be fixed entirely, or do we just have to accept that there will always be a certain drift / lag? I reckon #2200 reduces the drift for the most part (depending on portfolio activity, the drift could still be significant).
Even if we add more index update operations, the point you made here will still be true:
Just wondering if we can assume this issue to be fixed once #2200 is merged, or whether we need to go harder on properly maintaining the indexes in order to resolve it.
syalioune commentedon Dec 6, 2022
By design, there will always be an unwanted drift. However, I feel like we can spend some time reviewing the database update flow to identifiy trivial gaps to fill like the example given in the description.
Maybe also improve the implementation to make indexing easier, straightforward and oversight resistant. I'm thinking about DN Lifecycle listeners and Transaction synchronization to automatically hook into entities update and DN commit/rollback.
nscuro commentedon Sep 16, 2024
We started using lifecycle listeners as recommended in a few places:
dependency-track/src/main/java/org/dependencytrack/tasks/BomUploadProcessingTask.java
Lines 261 to 262 in ab9d19d
github-actions commentedon Oct 18, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.