ROX-27414: Prevent deduping Node Index in Central #13605
+10
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Condition
If Central receives NodeInventory and NodeIndex (IndexReport) messages in parallel for the same node...
Observed behavior
...the message that arrives later will get deduped.
Why is this a problem?
This is bad for many reasons:
Moreover
This change puts all Node, NodeInventory, and IndexReport into single worker queue. This shall prevent race condition if multiple events of those three kinds arrive very close to each other. The code in the pipelines is not bullet-proof regarding tight race conditions (that was a decision when working on Node scanning v2), because making it so, would require adding more complexity to it. Those situations can be prevented by using single worker for those type of messages, as it guarantees no parallelism among the messages handled by the same worker.
User-facing documentation
Testing and quality
Automated testing
How I validated my change